SFML community forums

Help => System => Topic started by: Mr. X on July 09, 2009, 01:23:51 pm

Title: Problem with sf::Randomizer. Seed isn't set in other threads
Post by: Mr. X on July 09, 2009, 01:23:51 pm
Hello,
I've noticed, that the Seed of sf::Randomizer is not automatically set if I use it in another thread than the main thread. This occures also if I use std::rand directly. Is there a workaround so that SFML sets the seed also automatically in other threads, or have I to set the seed in every thread myself?

Maybe SFML could set the seed everytimes a new thread is opened.
Title: Problem with sf::Randomizer. Seed isn't set in other threads
Post by: Laurent on July 09, 2009, 01:57:22 pm
This is a bug of some compilers, although the standard clearly says (as far as I remember) that the seed should be global to every thread.

I can't help much about that, sorry.
Title: Problem with sf::Randomizer. Seed isn't set in other threads
Post by: Mr. X on July 09, 2009, 02:10:45 pm
Ok, thanks for the answer. So I have to care about the seed.