Improving the speed of Thread interrupt checking
Charles Oliver Nutter
headius at headius.com
Sat May 11 01:53:54 PDT 2013
On Sat, May 11, 2013 at 3:37 AM, Alexander Turner <nerdscentral at gmail.com>wrote:
> Would not atomic increment and atomic decrement solve the multi-interrupt
> issue you suggest here? Such an approach is a little more costly because in
> the case of very high contention the setters need to spin to get the
> increment/decrement required if using pure CAS. That could be a lot of
> cache flushes - but it would then be strictly correct (I don't actually
> know how gcc or any other compiler goes about implementing add/sub):
>
> __sync_fetch_and_sub
> __sync_fetch_and_add
>
Yes, we could guarantee that all interrupts get seen and cleared
independently if we used an interrupt counter...but it's clear that's not
provided for by the contract of current Thread#interrupt logic, regardless
of how atomic you try to make it.
- Charlie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20130511/31b6ab90/attachment.html
More information about the mlvm-dev
mailing list