Re: Amber / Trident deadlock
- From: Kirill Grouchnikov <kirillcool@yahoo.com>
- To: dev@trident.kenai.com
- Subject: Re: Amber / Trident deadlock
- Date: Fri, 10 Jul 2009 09:20:10 -0700 (PDT)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=L4C7VvwM+slpAHFR8Z42JTDXX/0RjEbOxZ30zzmlmNB91S9B164FHlixN8x7FtZsBGMWZ7bAQ76igpcnQ3Lsp1l2r+mcs/nuQ/iZMipeSZuPDUpKEQ6eIa6gzUfYlytANsHdqI+EaAqG1wD/GSsew/tARa28EOdCVawxRayH9mA=;
Can you try this in your local Amber copy - TrendsVisualizer.showNextRow should end with
scenario.addCallback(new TimelineScenarioCallback() {
@Override
public void onTimelineScenarioDone() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
showNextRow();
}
});
}
});
Note how the call inside the callback is done on EDT.
The reason for not providing / respecting the RunOnUIThread annotation on timeline scenario callbacks is simple - a scenario can involve multiple timelines from different UI toolkits. So in this case the responsibility for running UI code properly is, unfortunately, on the application.
Please let me know if you run into this problem again.
Kirill
scenario.addCallback(new TimelineScenarioCallback() {
@Override
public void onTimelineScenarioDone() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
showNextRow();
}
});
}
});
Note how the call inside the callback is done on EDT.
The reason for not providing / respecting the RunOnUIThread annotation on timeline scenario callbacks is simple - a scenario can involve multiple timelines from different UI toolkits. So in this case the responsibility for running UI code properly is, unfortunately, on the application.
Please let me know if you run into this problem again.
Kirill
From: "remy.rakic@gmail.com" <remy.rakic@gmail.com>
To: dev@trident.kenai.com
Sent: Friday, July 10, 2009 4:38:51 AM
Subject: Amber / Trident deadlock
Wooohhooo i think i got it :)
> @lqd About the UI freeze in Twimber - can you install the
> org.pushingpixels.amber.utils.TracingEventQueueJMX as in the
test.TrendsSimulator?
There is no test.TrendsSimulator :p
I pushed the event queue anyway, and this is what i've got.
AWT-EventQueue-1 / BLOCKED
org.pushingpixels.amber.ImageHolderPanel.doLayout [105]
java.awt.Container.validateTree [-1]
java.awt.Container.validateTree [-1]
java.awt.Container.validateTree [-1]
java.awt.Container.validateTree [-1]
java.awt.Container.validate [-1]
javax.swing.RepaintManager.validateInvalidComponents [-1]
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run
[-1]
java.awt.event.InvocationEvent.dispatch [-1]
java.awt.EventQueue.dispatchEvent [-1]
org.pushingpixels.amber.utils.TracingEventQueueJMX.dispatchEvent [18]
java.awt.EventDispatchThread.pumpOneEventForFilters [-1]
java.awt.EventDispatchThread.pumpEventsForFilter [-1]
java.awt.EventDispatchThread.pumpEventsForHierarchy [-1]
java.awt.EventDispatchThread.pumpEvents [-1]
java.awt.EventDispatchThread.pumpEvents [-1]
java.awt.EventDispatchThread.run [-1]
Deadlocked threads:
Trident callback thread / BLOCKED
java.awt.Container.addImpl [-1]
java.awt.Container.add [-1]
org.pushingpixels.amber.ImageHolderPanel.addSingleImageHolder
[251]
org.pushingpixels.amber.ImageHolderPanel.getArticleSlideInTimeline
[169]
org.pushingpixels.amber.TrendsVisualizer.addArticleRow [227]
org.pushingpixels.amber.TrendsVisualizer.showNextRow [204]
org.pushingpixels.amber.TrendsVisualizer$4.onTimelineScenarioDone [209]
org.pushingpixels.trident.TimelineScenario$Chain.onTimelineScenarioDone
[73]
org.pushingpixels.trident.TimelineEngine$3.run [716]
org.pushingpixels.trident.TimelineEngine$TimelineCallbackThread.run
[259]
A number of methods inside ImageHolderPanel are synchronized, including
doLayout here, and since Container.addImpl is too while
Container.doLayout isn't, i think we might be onto something
here.However, I'm not sure the trident callback thread should be adding
components, wouldn't this callback be more appropriate on EDT ? I've
noticed there is no TimelineScenarioCallback that can be executed on
the various UI threads, is that correct ?
Rémy
| remy.rakic | 07/10/2009 | |
|
Re: Amber / Trident deadlock |
Kirill Grouchnikov | 07/10/2009 |
|
<Possible follow-up(s)> |
||
| remy.rakic | 07/10/2009 | |
| Kirill Grouchnikov | 07/10/2009 | |
| remy.rakic | 07/10/2009 | |
| Kirill Grouchnikov | 07/10/2009 | |
| Kirill Grouchnikov | 07/10/2009 | |
| remy.rakic | 07/10/2009 | |
| Kirill Grouchnikov | 07/10/2009 |





