MrPi
Member
|
Thread safety
I would like to get an introduction to thread safety in Esenthel Engine.
After studying the API reference I found a few spots that are supposed to be thread safe, such as EE::Cache, EE::Map, something with chunks in EE::Edit::Area::Area::Data.
Are there any other parts of the engine that can be made thread safe or are out of the box?
Let me make some basic examples:
a) Different objects change their physics (movement speed etc.) from different threads
b) Performing raycasts for hit detection from different threads
c) Adding new objects (i.e. player characters) from different threads
2) EE::ReadWriteSync
I would also like to know what this mutex is based on and whether it's an efficient implementation. Multiple reader / single writer mutexes usually come with significant overhead, which is why I'm asking.
Thanks.
|
|
08-18-2010 02:11 PM |
|
Esenthel
Administrator
|
RE: Thread safety
Hello,
If a method/functions isn't marked as thread-safe then it should be assumed as not thread-safe.
At the moment you should perform all the game logic/physics from the main thread.
2) It's based on CritSect and SyncEvent, it should be fast, there isn't much overhead there, but for testing its performance you should make some manual tests.
|
|
08-18-2010 07:44 PM |
|
MrPi
Member
|
RE: Thread safety
Thanks Grzegorz.
Let me forward 2) to all the other devs here. Has anyone collected some practical experiences with the EE::ReadWriteSync SWMR mutex? Anyone using it?
|
|
08-18-2010 08:56 PM |
|