On Fri, 2017-05-19 at 11:58 +0200, Francesco wrote:
> Hi,
> I'm using ZeroMQ in an applications with several threads (up to 40).
> I noticed that in the "master" branch of ZeroMQ the background
> threads
> it creates are given a name. That's VERY useful, thanks!

No problem. Had the same issue myself. One day I'd like to further
improve it to have more specific names (I/O, reaper, shutdown), but it
would require a lot more refactoring so for now all threads have the
same name.

> However my question is: my application sets the affinity and the
> priority of all threads it creates explicitly. Of course it  cannot
> set the affinity/priority of ZMQ background threads.
> Is it possible to add an API to get the pthread_t (on Linux) or the
> generic thread handle (platform-dependent) associated with the ZMQ
> background threads?
> 
> In that way my application would be able to set affinity and increase
> priority also of ZMQ background threads...

There is already an API to set those. Check the manpage for
zmq_ctx_set, and the following options: ZMQ_THREAD_SCHED_POLICY
ZMQ_THREAD_PRIORITY

Note that as the manpage says you need to set them before creating any
socket, immediately after creating the context.

Kind regards,
Luca Boccassi

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to