Hello Allen,

Allen Bierbaum wrote:
> I have been trying to wrap my head around this one for a while and
> can't convince myself or anyone else of how it works or how it should
> work.  So hear goes.
> 
> The baseline:
> 
> - OpenSG objects are created in aspects with change lists to sync
> between aspects
> - MTRecPtrs allow referencing objects across multiple aspects (and
> threads) by looking up the aspect associated with the current thread
> and looking at that copy of the object.

yup.

> But, what happens if:
> 
> - I have a primordial rendering thread and 2 background threads (P,
> B1, B2) (each with their own default OpenSG settings)
> - I create an object in P, store it with an MTRecPtr p_node, and share
> that Ptr with B1 and B2

you need to sync the aspect of P with those of B1 and B2 before you can 
access the object from either thread.
BTW this has not really changed from 1.x, except that in 1 the copies of 
P where already existing in the B1/B2 aspects, however they did *not* 
contain the correct values before the sync.

> - When B1 or B2 accesses it, what data do they see?  (assuming no
> manually changelist syncing)

if there has been no sync from the aspect of P to those of B1/B2 your 
application is likely to crash. The object you are trying to access does 
not exist before the sync.

> - What happens if in B1 I add a new node (b1_child) as a child of p_node?

b1_child only exists in the aspect of B1 until you sync from aspect of 
B1 to aspect of P and aspect of B2.

> Now option 2, what happens if I do this instead:
> 
> - Same as above, but I explicitly set the aspect id for all threads to
> be the same as the primordial thread

you have three threads operate on the same aspect so becomes your own 
responsibility to coordinate their actions.

        Cheers,
                Carsten

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to