Open Bug 1597527 Opened 5 years ago Updated 2 years ago

Give each worker type its own thread name

Categories

(Core :: DOM: Workers, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: asuth, Unassigned)

Details

Right now every worker thread gets named "DOM Worker" and this is what we see in crash stats and the Firefox Profiler and such. This currently comes from https://searchfox.org/mozilla-central/rev/131338e5017bc0283d86fb73844407b9a2155c98/dom/workers/WorkerThread.cpp#92. It would be nice to not have to guess about what type of worker a given thread is.

Since we don't number the workers and the maximum thread length is 16, I think we can go with explicit names:

  • "Dedicated Worker" length is 16
  • "Shared Worker" length is 13
  • "Service Worker" length is 14
  • "Chrome Worker" length is 13.

The one complication is that the RuntimeService has a concept of idle threads where it assumes that the threads are all interchangeable.

We have a method NS_SetCurrentThreadName, so we can update the names. It might make sense to also change the name in NoteIdleThread so it's "Idle Worker" with a length of 11.

Impacted Consumers

It seems like we'd also want to either update these locations that currently have a mapping for "DOM Worker" or file follow-up bugs:

The firefox profiler code proper doesn't seem to have any direct codification of DOM Worker, although it has some test cases that do: https://github.com/firefox-devtools/profiler/search?q=%22DOM+Worker%22&unscoped_q=%22DOM+Worker%22

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.