Thomas,

Thank you for your help.  I am still working on the problem.  Perhaps it is my lack of 
experience in threading.  What kind of setup do you recommend?  For example, I 
currently have the JSVGCanvas instantiated from the swing thread.  I have another 
thread I am using to listen to the UpdateManager events, and another thread I am using 
to have UpdateManager process DOM changes.  Do you recommend something more simple or 
robust?  Also, is the UpdateManager running on the same thread as the JSVGCanvas?  In 
my test code (running from the swing thread) I am waiting for the UpdateManager to 
fire the updateCompleted event.  If the UpdateManager is on the same thread then I 
will be waiting indefinitely correct?  Thank you for your patience.  I hope I am close 
to solving this problem!

Thanks!

-Mike

-----Original Message-----
From: Thomas DeWeese [mailto:[EMAIL PROTECTED]
Sent: Friday, March 19, 2004 7:23 PM
To: Batik Users
Subject: Re: invokeAndWait hang problem


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]


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

Reply via email to