Hi Mike,

   I really don't have any solid ideas to help, but I
have a few comments that might help sort this out.

1) There is essentially _no_way_ just the fact that you have
   references in the runnables causes the deadlock.  The
   problem must be in the code that was using those references
   (that had to be removed when then reference was removed).

2) As far as synchronization, invokeLater still guarantees
   order.  So if you call invokeLater twice the second
   invokeLater runnable will not start until the first one
   completes.

3) Have you looked at where the threads are deadlocking?
   On windows this can be done from a DOS window by pressing
   ctrl-break.  In UNIX I think it is a 'kill -3'.  The JVM
   will dump the stack trace for all threads so you can see
   where the UpdateManger thread is hung up.

   My first suspicion is that the first runnable is never
returning for some reason...

   As far as knowing when a runnable completes the easiest
thing to do is have it call a method when it is about to end.
You can also use wait and notify to 'wake up' another thread.

   There is currently no general event dispatch for runnable
completion.

Mike Favata wrote:

Thomas,

I did more experimenting and the problem stems from my runner classes having references to either the SVG document or an element of the SVG document. If you take the references out, both runners will execute with the invokeAndWait method. How
am I supposed to update the DOM within UpdateManager if I cannot reference parts of the DOM from within my runner classes? Also, why does the first runner succeed and the second hang? Any help would be greatly appreciated. Thanks!


-Mike

-----Original Message-----
From: Thomas DeWeese [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 5:56 PM
To: Batik Users
Subject: Re: invokeAndWait hang problem


Mike Favata wrote:


Hello all,

I am having trouble with the invokeAndWait method offered by UpdateManager. I am able to call invokeAndWait successfully in this block of code:


Hi Mike,

    I suspect that you are calling invokeAndWait from the
Swing event thread.  This is prone to causing deadlocks
as you have discovered.  You need to move the calls to
invokeAndWait to another thread.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to