Yair Kurzion (yair++at++polygon.engr.sgi.com)
Thu, 18 Nov 1999 13:42:30 -0800 (PST)
> Hey all. I have an application that has multiple threads changing data
> structures (DCSes, in particular) in a scene graph. Currently, a cube
> spins. Different threads update things about the cube. The cube spins fine
> for a while, but then will freeze up. I can navigate around the
> environment still, but the scene graph does not get traversed.
>
> Here's the million dollar question: what's going on? Does Performer
> protect it's data structures with mutual exclusion?
Performer has one copy of each node for the App process, and one for each
Cull process (more precisely, one for each graphic pipe). If you create threads
and let them write into the App copy (this is the one you get when you 'new'
a node), they will collide. Performer does not allow/support multiple writers
to the same copy of a node. Also, propagation of changes from the App copy down
stream to the Cull copies of a node will only happen if the changes happened in
the App process.
> How do I have multiple
> threads changing the same data, without causing this error.
I am sure you have some policy in mind when you say 'multiple threads changing
the same data'. If you want to take the simple path, then you should let the
App process collect all the outputs of your threads (implement your
multiple-writer policy here), and limit any node changes to the App process.
pfFlux buffers, pfEngines and pfFCS nodes come to mind as tools for propagating
information from non-Performer threads into the scene graph. I suggest that
you take a look at their man pages. They are all limited by the assumption
that your application will have one writer on each data field.
-yair
--
\_________ \_____ \__ \__ \_____ Yair Kurzion
\_________ \_____ \__ \__ \_____ yair++at++sgi.com
\__ \__ \____\__ \__ http://reality.sgi.com/yair
\__ \__ \__ Work: (650) 933-6502
\__ \__ \__ Home: (408) 226-9771
\__ \__ \__
This archive was generated by hypermail 2.0b2 on Thu Nov 18 1999 - 13:42:34 PST