RFR: 8216258: Make FreeIdSet semaphore-based

Kim Barrett kim.barrett at oracle.com
Tue Jan 8 00:58:17 UTC 2019

Please review this replacement of the "private" FreeIdSet with
G1FreeIdSet, which has a new implementation using a semaphore rather
than a monitor.

The representation of the set is largely the same, being an array of
"next" indices into the array, with a "head" value containing the
current first index.  However, the manipulation of the set is now done
without a lock, using CAS to change the head.  To avoid ABA, the head
value also contains an update counter which is incremented on each
modification of the head.

Also generalized to allow the id set to start with a non-zero id,
because that looks like it might simplify other changes I'm working

The entire "free id set" has been moved to new files and names (with
the usual G1 prefixing), to permit gtest-based unit testing.



mach5 tier1-5.

I didn't bother to do performance testing because I think our
performance tests rarely hit this code, so I don't expect the monitor
elimination to have any measureable effect for those tests.

More information about the hotspot-gc-dev mailing list