Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360105 - [DS] SCRManager waits too long to enable components
Summary: [DS] SCRManager waits too long to enable components
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: Juno M4   Edit
Assignee: Stoyan Boshev CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-06 10:35 EDT by Jens Kuebler CLA
Modified: 2011-11-21 04:29 EST (History)
1 user (show)

See Also:


Attachments
proposed patch (1.02 KB, patch)
2011-11-17 09:00 EST, Stoyan Boshev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Kuebler CLA 2011-10-06 10:35:43 EDT
Build Identifier: I20110613-1736

In case many components get activated on start up, the start time of eclipse significantly rises.
The reason is the Service Component Manager that sleeps for too long in case components get activated very fast.

SCRManager#startedBundle:
components.wait(1000);

a components.wait(10) suffices

Reproducible: Always
Comment 1 Thomas Watson CLA 2011-10-06 11:29:01 EDT
I would have thought the wait is waiting for a notification from another thread.  From what you state it sounds like this is not happening.
Comment 2 Jens Kuebler CLA 2011-10-06 11:39:01 EDT
Yes sometimes the 
workObject.notify()
in SCRManager#performWork
executes before the wait so it will wait the 1000msecs
Comment 3 Thomas Watson CLA 2011-10-06 14:13:00 EDT
(In reply to comment #2)
> Yes sometimes the 
> workObject.notify()
> in SCRManager#performWork
> executes before the wait so it will wait the 1000msecs

Then something is not right in the logic.  Shouldn't the loop use a while(condition)->do instead of do->while(condition)?  This way you avoid waiting when there is no longer anything to wait for.
Comment 4 Stoyan Boshev CLA 2011-10-07 02:06:04 EDT
(In reply to comment #3)
> Then something is not right in the logic.  Shouldn't the loop use a
> while(condition)->do instead of do->while(condition)?  This way you avoid
> waiting when there is no longer anything to wait for.

Yes, we can switch the "do-while" to "while" loop to fix this bug
Comment 5 Thomas Watson CLA 2011-10-07 11:23:41 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > Then something is not right in the logic.  Shouldn't the loop use a
> > while(condition)->do instead of do->while(condition)?  This way you avoid
> > waiting when there is no longer anything to wait for.
> 
> Yes, we can switch the "do-while" to "while" loop to fix this bug

Thanks Stoyan, I will mark this for juno.  Please release a fix when you have it.
Comment 6 Stoyan Boshev CLA 2011-11-17 09:00:44 EST
Created attachment 207144 [details]
proposed patch

Adding the discussed change as patch
Comment 7 Stoyan Boshev CLA 2011-11-21 04:29:17 EST
The patch is released in HEAD