Hi!
Yes, it is very bad idea to modify transforms (and other things) without
thread synch. But it is not quite sophisticated once you get it. So, first,
read more about 'synchronized' java statement, especially
'synchronized(refference_expression){//block}'. Later, note that your
problem is classical consumer-producer problem (assuming you have only one
math thread: Producer, and one java3d thread: consumer). You could find
different decissions in almost every semi-advanced CS textbook since 1960,
and 96 matches of '"consumer-producer problem"' search string in yahoo.
(http://trumpf-3.rz.uni-mannheim.de/~yoshida/parpro-cd/java/exschan.htm is
one of them, don't ask me what the XXXX is that).
A classical solution: manage a queue with producer's production and let
consumer read from it only if it is not empty AND producer does not work on
it.

I'm sorry i can not give more useful links and advises. My boss always laugh
at me when i do some math support and mess off the programming: 'It
(programming) is not analytical geometry ha ha ha'. Let prove him that the
It is easier! :)


>From: David Charles Hirschfield <[EMAIL PROTECTED]>
>Reply-To: Discussion list for Java 3D API <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [JAVA3D] HELP: Thread Synchronization
>Date: Sun, 23 Apr 2000 18:51:54 -0400
>
>I haven't been able to find much in the way of documentation on this
>subject, so any help will be greatly appreciated.
>
>I have a physics simulation running which simulates the gravitational
>interaction of a bunch of masses in 3d space. That simulation code is
>entirely mathematical and runs in its own thread, producing a set of 3d
>positions every time it runs.
>
>Those 3d positions are then used to set the positions of some objects in
>a java3d scene. Basically I take the x,y,z position that the math thread
>calculated and shove it into the transform of the java3d object.
>
>Everything works OK for a little while, but then the java3d thread comes
>to a screeching halt, while the simulation thread continues to run.
>
>Is this a thread locking issue? Is it not good to modify the transforms
>of java3d objects without some sophisticated thread synching? If I don't
>run the simulation thread, the java3d thread will run without problems,
>so I know it is the interaction between the two that is the problem.
>
>Has anyone had a similar problem?
>Please help, I've been banging my head against this one for a while, but
>I have had no luck.
>
>Pointers to documentation or examples would be great.
>-David
>
>===========================================================================
>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".

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

===========================================================================
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