Hi there,

We have a tiny patch that we feel would better live upstream, so that we 
can name lib worker threads, which is helpful when debugging a program with 
a lot of threads (in gdb, or with perf top etc...).

We use pthread_setname_np for that which only works on unix but it can be 
made portable relatively easily (I have a wrapper here 
https://github.com/machinezone/IXWebSocket/blob/master/ixwebsocket/IXSetThreadName.cpp)
 
that works for windows/macOS/freebsd/linux at. least). If we expose a set 
api, we probably need a get api to be well behaved.

We use it to give the same name to all the worker threads but we could 
probably add a _1, _2 et.... for each of them. Or maybe we don't even need 
to do that, and libuv could name those threads itself ?

Also we have a function to query how many idle threads there are 
(uv_queue_work_idle_threads).

How does the community feel about those ? Should we start making PR for 
that ?

Thanks !
- Benjamin

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to libuv+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/libuv/8887f055-a2c8-44f4-ad8a-9376bc8a7f54n%40googlegroups.com.

Reply via email to