Hello,

after debugging my randomly crashing multithreaded OpenSG application  
for several hours, I've had to realize that the problem is actually  
the OSG::Log which to my big surprise is not thread-safe. Whenever you  
write something into the log, the method OSG::Log::doLog() gets  
called, which uses one single static buffer to assemble the message.  
This method is protected by OSG::lock() and OSG::unlock(). Both  
methods are not implemented and empty.

My naive idea now was to implement these methods by creating an  
OSG::Lock object. But to my surprise, that also crashed, because you  
can only create OSG::Lock objects after the OpenSG type system gets  
initialized, and OSG::Log gets created before the type system gets  
initialized.

This problem exists in OpenSG 1 as well as OpenSG 2.

So this leads me to the final conclusion: Despite the fact that a lot  
of effort has been made to make OpenSG thread-safe, and despite the  
fact that it is frequently claimed on the OpenSG mailing lists that  
OpenSG is especially dedicated to multithreaded applications, you  
cannot use OpenSG in a multithreaded environment because it may crash  
anytime when someone writes something into the log.

That is not really a convincing situation. I think that should be  
fixed immediately. Unfortunately, I'm running out of ideas. What do  
other people think?

Bye,

Patrick


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to