Bug 216461 - [Jobs] The ability to pause and resume jobs would be useful
Summary: [Jobs] The ability to pause and resume jobs would be useful
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-24 10:55 EST by Michael Valenta CLA
Modified: 2013-11-10 22:31 EST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2008-01-24 10:55:33 EST
The ability to pause and resume jobs from the Progress View would be useful, especially for long running jobs that involving transferring content using protocols that support pause/resume. It could also be applied to Eclipse builds. Of course, not all jobs would support this so there would need to be API added that would allow the view to determine whether a Job was pausable or not and to pause and resume such a job.
Comment 1 John Arthorne CLA 2008-01-24 11:18:16 EST
There is sleep/wakeUp API on jobs, but it doesn't work for jobs that are already running. I considered this, but thought it was too high a barrier for job implementations to support it (they would need to capture and remember their current state in order to be able to pick up where they left off).  

Still, it's an interesting idea to keep in mind. One implementation approach would be for jobs to be able to declare that they are resumable. If resumable, a pause/resume button would appear in the progress view. Pausing the job would invoke Job#cancel(), and resume would invoke Job#schedule to restart it.  It would be up to the job to pick up where it left off.
Comment 2 Mike Wilson CLA 2008-01-24 14:17:59 EST
You would definitely want the job to declare that it was resumable, rather than require all jobs to support it.

Kevin, this is the idea I talked to you about.


Comment 3 Juan omínguez CLA 2008-03-10 09:51:32 EDT
Perhaps another option would be not to cancel/reschedule a a pausable job, but just to block its execution. 
Obviously all the resources held by the job, will be still blocked while the job is paused, but the cpu and I/O consumption of the job would be 0. 
What I'm thinking about is the search jobs, which don't hold any locks (I suppose), but take a lot of I/O resources. I think it would be useful to be able to block the search (not just cancel it), in order to avoid disk trashing, for example for launching an application or other I/O bound jobs. Once the application is launched, the search can be resumed.
Comment 4 John Arthorne CLA 2008-03-19 16:30:26 EDT
> Perhaps another option would be not to cancel/reschedule a a pausable job, but
> just to block its execution.

There is no safe way to do this in Java. The deadlock risk is too great. For example the thread may own some lock that the UI thread is blocked on, and there would be no way to resume it.
Comment 5 Susan McCourt CLA 2009-07-09 19:38:47 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 6 Prakash Rangaraj CLA 2009-07-10 04:36:56 EDT
The UI can't add any support unless the Job supports IResumable/ pause/resume methods. Is UI a right component for this bug or should I move it to Runtime?