RFR(xs): 8134744: WorkerThread::id() should match GangWorker's worker_id
Per Liden
per.liden at oracle.com
Tue Sep 1 06:22:33 UTC 2015
Hi Jon,
On 2015-08-31 20:35, Jon Masamitsu wrote:
> Per,
>
> A GangWorker is given an "uint id" when it is
> created. If it is going to be reset the id whenever it
> does work, should it have its own "id"?
Yes, WorkerThread should still have an id (there are other users of it,
like ParallelGC). It's also very valuable to be able to retrieve the id
from contexts where you aren't easily able to pass the worker_id that
was passed to the work() function.
The id passed to the AbstractGangWorker's constructor is only used to
give it a unique name. The call to set_id() there is kind of
superfluous, as it will be overridden anyway.
/Per
>
> Jon
>
> On 08/31/2015 07:16 AM, Per Liden wrote:
>> Hi,
>>
>> This is a follow up patch to JDK-8134749 (SoftReferences declared dead
>> too early), which makes sure WorkerThread::id() and match GangWorker's
>> worker_id always match. This allows them to be used interchangeably,
>> which is both convenient and removes a potential source for bugs (it's
>> easy to assumed they are the same). This change should not affect any
>> existing code.
>>
>> Webrev: http://cr.openjdk.java.net/~pliden/8134744/webrev.0/
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8134744
>>
>> Testing: jprt
>>
>> /Per
>>
>
More information about the hotspot-gc-dev
mailing list