Closed Bug 606102 Opened 14 years ago Closed 12 years ago

Allow XPCOM threads to be given a name visible to the underlying OS

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: cjones, Unassigned)

References

Details

Attachments

(1 file)

See bug 606062 comment 0: this can be very useful for gross profiling, because with named threads can simply look at which threads are chewing CPU in a tool like |top| and say, e.g., "oh, that's the Sync thread". The patch I'm about to attach just adds support for linux.
I should add that NSPR is a better place for this code, but I don't have the motivation to attempt a new NSPR interface, and bug 507718 would obsolete that code anyway.
For reference the windows equivalent will need to do something like the chromium code: http://mxr.mozilla.org/mozilla-central/source/ipc/chromium/src/base/platform_thread_win.cc#12
It's serious, thread names are only stored by the debugger on Windows, not the OS, and that's the documented way of communicating a preferred thread name to the debugger.
Comment on attachment 484967 [details] [diff] [review] Add nsIThreadManager.newNamedThread() for creating threads with OS-visible names I'd kinda prefer to just make this nsIThread newThread(in unsigned long creationFlags, [optional] in string name) Or just ditch creationFlags since we're not using it anyway. But this can wait until after branch, so I'm going to just clear the review flag for now.
Attachment #484967 - Flags: superreview?(benjamin)
We did this work in another bug.
Assignee: jones.chris.g → nobody
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: