Multithreading Revisited

Galun said:

By the way: Is there a special reason why a Trimesh can be created outside the GL thread but not a SwitchNode? If a SwitchNode is created in another thread it simply keeps invisible without an error message or exception.


Looking at the code, I can't find any reason why this should be.  Did you remember to call updateRenderState()?  Could that be the problem?

updateRenderState should be thread safe from a GL point of view, but further inspection would be needed to say it was safe from a data point of view if you, for example, were editting the scenegraph from two different threads.  (Personally, I think it is safe there too, and if not, it should be.)

I kept everything the same just the call is done in the GL thread and it works. So I don't think it's one of my beloved update functions.