Problem: ZMQ background threads are unnamed

Solution: use pthread API to set the name. For now call every thread
"ZMQ b/g thread". Would be nice to number the I/O threads and name
explicitly the reaper thread, but in reality a bit of internal API
churn would be necessary, so perhaps it's not worth it.
This is useful when debugging a process with many threads.
This commit is contained in:
Luca Boccassi
2017-02-28 19:45:23 +00:00
parent 3548d5e950
commit 3ab4796c5a
7 changed files with 137 additions and 0 deletions

View File

@@ -412,6 +412,7 @@ void zmq::ctx_t::start_thread (thread_t &thread_, thread_fn *tfn_, void *arg_) c
{
thread_.start(tfn_, arg_);
thread_.setSchedulingParameters(thread_priority, thread_sched_policy);
thread_.setThreadName ("ZMQ b/g thread");
}
void zmq::ctx_t::send_command (uint32_t tid_, const command_t &command_)