Hi,
"Beyond mutexes, I am less skilled with thread synchronisation. But in
other libraries like Qt sometimes the concept of thread local storage
is used to separate resource access from parallel threads. Do you
think this concept would be applicable to provide every thread with
its own stream? Would this concept be more efficient compared to
mutexes? I could imagine that every thread writes to an own stream
which then calls the *same* osg::NotifyHandler subclass. This way, the
notify handler would be responsible for thread-safeness again (as it
is now)."

It's always problem of standard library. Creating output streams for every 
thread is overkill and not safe either. What if internal implementation of new 
streams will call some static internal write() function that won't be 
threadsafe ?

"I agree with the argument not to add extra mutexes. But what do you
mean with "assumption that stream are thread safe"? Obviously neither
the stream implementation of the Visual compiler under Windows nor the
one of the GNU compiler under Lubuntu are thread-safe by nature. Do
you know any such implementations or platforms or maybe compiler flags
which fulfill this assumption?"

I agree with that too. Solution using custom osg::NotifyHandler with mutexes is 
easy and it dont have to be in osg core library, what about using NotifyHandler 
with mutexes if OSG_NOTIFY_LEVEL is set ? 
Ok the problem will always persist, if someone use std::out directly, but that 
is not OSG problem ....
Cheers,
Filip

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48136#48136





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to