RFR: 8073464 - GC workers do not have thread names

Thomas Schatzl thomas.schatzl at oracle.com
Tue Mar 3 11:05:47 UTC 2015

Hi David,

On Tue, 2015-03-03 at 10:02 +0100, David Lindholm wrote:
> Hi,
> On 2015-02-20 16:01, Thomas Schatzl wrote:
> > Hi,
> >
> > On Fri, 2015-02-20 at 14:39 +0100, David Lindholm wrote:
> >> Hi,
> >>
> >> Please review this small fix in GangWorker:initialize(). This addition
> >> sets the native thread names of GangWorker threads, which the GC uses
> >> for worker threads. Now these names will be visible when debugging in GDB.
> >>
> > Also, wouldn't it be much more useful to set the native thread name for
> > all NamedThreads to the name that is passed via set_name() by default?
> > This would prevent us from doing this work multiple times.
> Ok, this new patch does this for all NamedThreads.


> > You might also fix the names themselves for gc owned threads in this CR.
> > I do not see the need to split this up in CRs per thread type with each
> > CR being a one-line change.
> The changes of all the thread names will be handled in a separate 
> change. There is a separate bug for this.
> I have also changed the copyright year in the changed files, even though 
> I think it is a weird process to do this separately for every change.
> New webrev: http://cr.openjdk.java.net/~brutisso/8073464/webrev.01/
> I have run and passed JPRT on this change.

Looks good.

It would be nice to have an initialize_in_thread() method in NamedThread
that all descendants call. If you look at the current code, all
NamedThread children duplicate the calls to
record_stack_base_and_size(), initialize_thread_local_storage(), and
initialize_named_thread(). However I am not insisting on doing this
cleanup in this CR if you do not want to. In that case, please create a
new cleanup CR for that.


More information about the hotspot-gc-dev mailing list