Bug 36894 - JobManager could wait when idle
Summary: JobManager could wait when idle
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-25 07:59 EDT by Philipe Mulet CLA
Modified: 2003-06-06 10:53 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2003-04-25 07:59:51 EDT
Build R2.1

Until some Job is queued again, the JobManager should wait instead of actively 
sleeping.
Comment 1 Kent Johnson CLA 2003-05-01 13:06:50 EDT
The Thread methods named resume(), suspend() & stop() have all been deprecated 
since 1.3 (because of the potential for deadlock).

The only supported protocol I can find for background threads is to sleep.
Comment 2 Philipe Mulet CLA 2003-05-06 05:37:37 EDT
What about Object.wait() and Object.notify(), see ReadWriteMonitor.
Comment 3 Kent Johnson CLA 2003-05-13 12:10:53 EDT
Ok, I've made the changes & they work BUT our tests are failing in random spots 
because of timing issues.

Since the IndexManager was sleeping upto 500ms before starting a new job, it 
was possible for tests to create & delete resources without conflicts. Now the 
IndexManager opens any new resource right after the job is posted... this 
prevents the test from deleting the resource. I've added retry loops in the 
tests where possible, but some calls are to the JavaModel move command, where 
its impossible to know if retry will work.
Comment 4 Kent Johnson CLA 2003-05-14 15:11:28 EDT
In the released changes we are no longer actively sleeping, but instead wait 
for a new job to be posted... but instead of processing it immediately, we give 
the main thread a bit of time to finish before starting to process the job.
Comment 5 David Audel CLA 2003-06-06 10:53:45 EDT
Verified.