Request for code review - JDK-8141123 Change int's to size_t in FreeIdSet
Kim Barrett
kim.barrett at oracle.com
Wed Dec 2 01:23:53 UTC 2015
On Dec 1, 2015, at 6:45 PM, Kim Barrett <kim.barrett at oracle.com> wrote:
>
> However, given that we've apparently never had any callers of
> set_safepoint, it is perhaps OK to go ahead and remove it, and have
> additional followups to look into the various issues mentioned here.
Yet more problems with the existing code.
A FreeIdSet is constructed with a pointer to a Monitor, which is used
to protect it. The Monitor that is provided for the FreeIdSet used by
DirtyCardQueueSet is the Shared_DirtyCardQ_lock, which is actually a
Mutex. Mutex doesn't support notify_all and wait, both of which are
used by FreeIdSet. If enough threads attempt to allocate an id (in
mut_process_buffer) that some will wait, the wait in claim_par_id and
the associated notify_all in release_par_id will accidentally work,
because Mutex is weirdly derived from Monitor rather than the other
way around or some other arrangement, so that the Mutex* gets
implicitly converted to a Monitor*, thereby slicing off
Mutex::notify_all and Mutex::wait and instead using the Monitor
functions.
More information about the hotspot-gc-dev
mailing list