JOBs and waiting in the UI. [message #231206] |
Mon, 19 April 2004 12:12  |
Eclipse User |
|
|
|
Originally posted by: richkulp.NO.SPAM.us.ibm.com
I have a JOB that can be run scheduled from either a UI thread or a
non-UI thread. I need to be able to join up on the job, again either on
the ui thead or the other thread, but I can't have the UI thread stop
processing the display queue.
Does the job.join() operation understand that the thread waiting is a UI
thread, and so will keep the UI thread spinning?
If it does hold up the UI thread, is there a good way of keeping the UI
thread active, but still waiting at that point and not returning until
the job is finished.
Does the IJobManager.begin(ISchedulingRule) also understand that it
could be coming in from a UI thread, and if the rule says block, it
keeps the UI thread spinning but doesn't return until the scheduling
rule is satisfied?
--
Thanks, Rich Kulp
|
|
|
Re: JOBs and waiting in the UI. [message #233645 is a reply to message #231206] |
Fri, 23 April 2004 16:38   |
Eclipse User |
|
|
|
Originally posted by: John_Arthorne.oti.com_
You should not rely on either of those things happening. If you want
the UI to wait for some indefinite period of time, use a modal progress
mechanism such as the progress service. You need something like this:
PlatformUI.getWorkbench().getProgressService().run(runnable, true, true);
Where "runnable" is an implementation of IRunnableWithProgress that does
the join, lock.acquire(), or other such blocking call.
--
Rich Kulp wrote:
> I have a JOB that can be run scheduled from either a UI thread or a
> non-UI thread. I need to be able to join up on the job, again either on
> the ui thead or the other thread, but I can't have the UI thread stop
> processing the display queue.
>
> Does the job.join() operation understand that the thread waiting is a UI
> thread, and so will keep the UI thread spinning?
>
> If it does hold up the UI thread, is there a good way of keeping the UI
> thread active, but still waiting at that point and not returning until
> the job is finished.
>
> Does the IJobManager.begin(ISchedulingRule) also understand that it
> could be coming in from a UI thread, and if the rule says block, it
> keeps the UI thread spinning but doesn't return until the scheduling
> rule is satisfied?
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03345 seconds