I have gotten no response after submitting this message twice to this
message group and once to the Java3D beta program. Surely someone out there
can at least tell me if it looks like I'm using synchronization properly in
theory?

-----Original Message-----
From: Kasparian, Raffi J. [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 12:26 PM
To: [EMAIL PROTECTED]
Subject: [JAVA3D]


To all,

I have a Behavior that performs the following code during it's
processStimulus.

synchronized( v ){// v is a Vector and a variable member of this class.
        for( Enumeration e2 = v.elements(); e2.hasMoreElements(); ){
                OrderableBehavior r = (OrderableBehavior)e2.nextElement();
                        r.run();
        }
        v.clear();
}



Depending on what elements v contains the J3D-renderer thread can stop dead
in its tracks (no Exceptions, no rendering) at the synchronized statement.
All other theads seem to work fine. Commenting out the synchronized
statement eliminates the problem. Could I be breaking some rule by my use of
synchronization? or does this sound like a J3D problem? My intention is
simply to prevent v from gaining any more elements (other behaviors add
elements to v) until after it has finished its loop and cleared.

Thanks,

Raffi

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to