|How to obtain a progress monitor w/o a Job? [message #782079]
||Mon, 23 January 2012 00:18
| Marcel Bruch
Registered: July 2009
I've a plug-in that extensively makes use of thread pools to execute operations. The thread pool is used to ensure a few things:
1. Threads should run on a minimal priority and should not disturb the IDE experience. Best, they compute things only if a CPU is idle.
2. At most, a MAX number of operations should be executed at the same time.
3. Some operations should report back to the Eclipse progress bars and views.
Obviously, the Jobs API seems to be a good fit for 3. But how can I ensure 1 and 2?
Is job.setPriority(DECORATE) similar to Thread.MIN_PRIORITY?
Can/should ISchedulingRules be used to limit the number of active jobs of the same kind?
There are potentially hundreds of Jobs that would get scheduled at the same time. If the Jobs API is not the right solution to this, is there a (standard) way to obtain a IProgressMonitor to use in your own threads (outside the Jobs framework)?
Thanks for advice.