[zeromq-dev] ZeroMQ background threads

Francesco francesco.montorsi at gmail.com
Fri May 19 12:25:41 CEST 2017


Wow, great, I didn't know about ZMQ_THREAD_SCHED_POLICY and
ZMQ_THREAD_PRIORITY, thanks!!

Francesco


2017-05-19 12:20 GMT+02:00 Luca Boccassi <luca.boccassi at gmail.com>:
> 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
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list