Jobs API / Workspace.run() and Display.syncExec() [message #325830] |
Thu, 28 February 2008 07:22  |
Eclipse User |
|
|
|
Hi,
currently I face some problems with some coding that
uses Workspace.run(IWorkspaceRunnable, IProgressMonitor).
When that coding gets executed in the main thread I
experience a deadlock. Another thread is executing a Job
which owns a ResourceRule and tries to access the main
thread with Display.syncExec(). And the main thread is
blocked while trying to obtain the SchedulingRule for the
Workspace.
I wonder is there a policy that implies which coding is in
error in that situation. Or in other words, would you say
that:
a) It is wrong to obtain a SchedulingRule while in the main
thread.
or
b) It is wrong to call Display.syncExec() while holding a
SchedulingRule.
Or should I try to avoid both?
Or are there no rules?
Thank you for any help you can provide and best regards,
Holger Oehm
--
SAP AG
Dietmar-Hopp-Allee 23
D-69190 Walldorf
T+49 6227 7-66421
mailto:holger.oehm@sap.com
www.sap.com
Sitz der Gesellschaft/Registered Office: Walldorf, Germany
Vorstand/SAP Executive Board: Henning Kagermann (Sprecher/CEO), Léo
Apotheker (stellvertretender Sprecher/Deputy CEO), Werner Brandt, Claus
Heinrich, Gerhard Oswald, Peter Zencke
Vorsitzender des Aufsichtsrats/Chairperson of the SAP Supervisory Board:
Hasso Plattner
Registergericht/Commercial Register Mannheim No HRB 350269
Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige
vertrauliche Informationen enthalten. Sollten Sie diese E-Mail
irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts,
eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt.
Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail.
Vielen Dank.
This e-mail may contain trade secrets or privileged, undisclosed, or
otherwise confidential information. If you have received this e-mail in
error, you are hereby notified that any review, copying, or distribution
of it is strictly prohibited. Please inform us immediately and destroy
the original transmittal. Thank you for your cooperation.
|
|
|
Re: Jobs API / Workspace.run() and Display.syncExec() [message #325849 is a reply to message #325830] |
Thu, 28 February 2008 16:19  |
Eclipse User |
|
|
|
Originally posted by: eclipseng.arthorne.com
This particular case should actually not deadlock. The platform manages
this by allowing syncExecs to execute from a thread that owns a lock
that the UI thread is waiting for. I suggest entering a bug against
platform resources with the deadlock stack trace so it can be diagnosed
further. In general though, it is best to avoid obtaining locks in the
UI thread because it makes your application unresponsive.
--
Holger Oehm wrote:
> Hi,
>
> currently I face some problems with some coding that
> uses Workspace.run(IWorkspaceRunnable, IProgressMonitor).
>
> When that coding gets executed in the main thread I
> experience a deadlock. Another thread is executing a Job
> which owns a ResourceRule and tries to access the main
> thread with Display.syncExec(). And the main thread is
> blocked while trying to obtain the SchedulingRule for the
> Workspace.
>
> I wonder is there a policy that implies which coding is in
> error in that situation. Or in other words, would you say
> that:
>
> a) It is wrong to obtain a SchedulingRule while in the main
> thread.
>
> or
>
> b) It is wrong to call Display.syncExec() while holding a
> SchedulingRule.
>
> Or should I try to avoid both?
>
> Or are there no rules?
>
> Thank you for any help you can provide and best regards,
> Holger Oehm
>
|
|
|
Powered by
FUDForum. Page generated in 0.02353 seconds