[zeromq-dev] Does the zeromq support the spin_lock internally?

Pieter Hintjens ph at imatix.com
Wed Mar 14 21:10:05 CET 2012


This is an excellent idea. If you want to send a patch (pull request),
and test case, we can merge that into the master.


> When I took a look at the source codes, it shows the ctx_t class
> implementation uses the pthread mutex locking mechanism.  In general, it
> works fine in many applications.   For the SMP architecture, the system runs
> the multicore and each worker thread can acquire the CPU to run for the
> completeness at the same time.  If use the Zeromq for the “inproc”
> communication, the inter-thread transport doesn’t need the I/O thread, and
> all messages are in the memory.   It’s nice to have the spin_lock
> implemented inside the Zeromq, instead of pthread mutex for this
> situation.   It can reduce the context switch to cause the performance
> penality.  Do you have any idea to work around or plan to support it?
> Thanks.
> -Richard
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

More information about the zeromq-dev mailing list