Postby Jamarr » Wed Aug 04, 2010 17:06
How do you define "thread safe"? In terms of the SGI STL, they define "thread safe" only as concurrent read access. In other words, if multiple simultaneous threads can safely read from an object, then it is considered to be thread-safe.
In the case above, the user is writing in one thread and reading in another. In this case it is the clients responsibility to ensure mutual exclusion between threads, because it is simply too inefficient to make every object operation atomic. And in some cases the client code would have to specify when to lock anyway; for instance, if thread1 needs to read from and write to the object, and thread2 tries to write to the object after the read but before the write in thread1, the user would still need to manually specify the locking operations.
So my question is, does CEGUI modify windows during System::renderGUI? If it does not, then I think we can consider CEGUI to be thread safe, at least in the sense that it is the clients responsibility to ensure mutual exclusion when performing write-operations. If it does, then we may want to look into why CEGUI needs to modify a window in the drawing phase and perhaps see if that can be refactored.
If somebody helps you by replying to your thread,
upvote him/her as a thanks! Make sure to include your
CEGUI.log and
everything you tried when posting! And remember that we are not
magicians!