You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Yaroslav Bulatov <ya...@gmail.com> on 2006/11/08 02:30:28 UTC

bug with invokeLater?

I used canvas.getUpdateManager().getUpdateRunnableQueue().
    invokeLater(new Runnable())  to update DOM tree, but was running
into deadlock sometimes. I noticed that "synchronized" block in
RunnableQueue.run doesn't have "notify" at the end. If I add
list.notify() there, I no longer get deadlocks.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: bug with invokeLater?

Posted by th...@kodak.com.
Hi Yaroslav,

"Yaroslav Bulatov" <ya...@gmail.com> wrote on 11/14/2006 01:53:50 PM:

> Thomas DeWeese wrote:
> >     No, I don't think so.  There is a problem if you use
> > invokeAndWait from the Swing thread but AFAIK invokeLater doesn't
> > have (and hasn't had) deadlock issues.
> 
> I'm calling it from the thread called "AWT-EventQueue-0", more
> specifically it's getting called when "gvtRenderingCompleted" is
> called on GVTTreeRendererListener....is that a problem?

   As long as you call invokeLater there is not a problem.
If you are calling invokeAndWait then there will be a problem
depending on what DOM manipulations you are making...


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: bug with invokeLater?

Posted by Yaroslav Bulatov <ya...@gmail.com>.
> Hi Yaroslav,
>
> "Yaroslav Bulatov" <ya...@gmail.com> wrote on 11/08/2006 08:44:04 PM:
>
> > Another place that waits on the list is the RunnableQueue.invokeLater()
> method.
>
>    No invokeLater does not wait on the list.  It synchronizes on it, you
> don't have to notify a thread that is blocked on a synchronize, it will
> drop through when the resource becomes available.
>
> > So wouldn't it deadlock if I do
> > canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater() while
> > the runnableQueueThread is running?
>
>     No, I don't think so.  There is a problem if you use
> invokeAndWait from the Swing thread but AFAIK invokeLater doesn't
> have (and hasn't had) deadlock issues.

I'm calling it from the thread called "AWT-EventQueue-0", more
specifically it's getting called when "gvtRenderingCompleted" is
called on GVTTreeRendererListener....is that a problem?

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: bug with invokeLater?

Posted by th...@kodak.com.
Hi Yaroslav,

"Yaroslav Bulatov" <ya...@gmail.com> wrote on 11/08/2006 08:44:04 PM:

> Another place that waits on the list is the RunnableQueue.invokeLater() 
method.

   No invokeLater does not wait on the list.  It synchronizes on it, you
don't have to notify a thread that is blocked on a synchronize, it will
drop through when the resource becomes available.

> So wouldn't it deadlock if I do
> canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater() while
> the runnableQueueThread is running?

    No, I don't think so.  There is a problem if you use
invokeAndWait from the Swing thread but AFAIK invokeLater doesn't
have (and hasn't had) deadlock issues.

> I'm using the latest version from SVN (revision 471768)



> 
> 
> On 11/8/06, thomas.deweese@kodak.com <th...@kodak.com> wrote:
> > Hi Yaroslav
> >
> > "Yaroslav Bulatov" <ya...@gmail.com> wrote on 11/07/2006 08:30:28 
PM:
> >
> > > I used canvas.getUpdateManager().getUpdateRunnableQueue().
> > >     invokeLater(new Runnable())  to update DOM tree, but was running
> > > into deadlock sometimes. I noticed that "synchronized" block in
> > > RunnableQueue.run doesn't have "notify" at the end. If I add
> > > list.notify() there, I no longer get deadlocks.
> >
> >     I don't think this fixed your problem.  The only code that
> > wait's on the list is the RunnableQueue.run method, which obviously
> > can't be waiting when you call notify, so while I don't think your
> > change is dangerous I don't think it fixes anything.
> >
> >     You don't say what version of Batik you are using, we have
> > fixed some small deadlock issues since 1.6 was released.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: bug with invokeLater?

Posted by Yaroslav Bulatov <ya...@gmail.com>.
Another place that waits on the list is the RunnableQueue.invokeLater() method.
So wouldn't it deadlock if I do
canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater() while
the runnableQueueThread is running?

I'm using the latest version from SVN (revision 471768)


On 11/8/06, thomas.deweese@kodak.com <th...@kodak.com> wrote:
> Hi Yaroslav
>
> "Yaroslav Bulatov" <ya...@gmail.com> wrote on 11/07/2006 08:30:28 PM:
>
> > I used canvas.getUpdateManager().getUpdateRunnableQueue().
> >     invokeLater(new Runnable())  to update DOM tree, but was running
> > into deadlock sometimes. I noticed that "synchronized" block in
> > RunnableQueue.run doesn't have "notify" at the end. If I add
> > list.notify() there, I no longer get deadlocks.
>
>     I don't think this fixed your problem.  The only code that
> wait's on the list is the RunnableQueue.run method, which obviously
> can't be waiting when you call notify, so while I don't think your
> change is dangerous I don't think it fixes anything.
>
>     You don't say what version of Batik you are using, we have
> fixed some small deadlock issues since 1.6 was released.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: bug with invokeLater?

Posted by th...@kodak.com.
Hi Yaroslav

"Yaroslav Bulatov" <ya...@gmail.com> wrote on 11/07/2006 08:30:28 PM:

> I used canvas.getUpdateManager().getUpdateRunnableQueue().
>     invokeLater(new Runnable())  to update DOM tree, but was running
> into deadlock sometimes. I noticed that "synchronized" block in
> RunnableQueue.run doesn't have "notify" at the end. If I add
> list.notify() there, I no longer get deadlocks.

    I don't think this fixed your problem.  The only code that
wait's on the list is the RunnableQueue.run method, which obviously
can't be waiting when you call notify, so while I don't think your
change is dangerous I don't think it fixes anything.

    You don't say what version of Batik you are using, we have
fixed some small deadlock issues since 1.6 was released.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org