SFML community forums
Help => Window => Topic started by: mercurio7891 on January 15, 2011, 06:40:50 am
-
Hi, is there anyway inbuilt thread safe flag in sfml which I can specify to allow calls to be thread safe? or do I have to manually wrap every sfml call with a mutex.
for e.g sf::Window::SetPosition which can be access from multiple thread.
Must I have a mutex for every SetPosition call?
regards
-
SFML is not thread safe, you have to protect yourself the variables that may be accessed by multiple threads. Which is by the way far more optimal than providing thread-safety by default in SFML.
-
Wrapping anything with mutexes or the like is far from optimal and more or less works against parallel programming. Making SFML thread-safe by default wouldn't help, actually be bad.