RFR: 8011882: Replace spin loops as back off when suspending

Staffan Larsen staffan.larsen at oracle.com
Thu Apr 11 06:10:41 PDT 2013


Looks good to me.

/Staffan

On 11 apr 2013, at 13:51, Rickard Bäckman <rickard.backman at oracle.com> wrote:

> Hi all,
> 
> can I please have reviews for this change. 
> 
> In the current implementation do_suspend uses spin loops to wait until a thread has been suspended. I would like to change that to use semaphores to reduce CPU usage and also make it easier to have a deterministic timeout. Since we are posting to the semaphore in the signal handler we can't use pthread_semaphore since it isn't async safe, which is why all implementations uses low-level os-specific semaphore constructs.
> 
> Bug: http://bugs.sun.com/view_bug.do?bug_id=8011882
> Webrev: http://cr.openjdk.java.net/~rbackman/8011882/
> 
> Thanks
> /R



More information about the hotspot-runtime-dev mailing list