[zeromq-dev] [PATCH] Scalability improvements for large amounts of connections
Martin Sustrik
sustrik at 250bpm.com
Mon Oct 11 16:46:43 CEST 2010
On 10/11/2010 04:13 PM, Pieter Hintjens wrote:
> On Mon, Oct 11, 2010 at 4:08 PM, Martin Sustrik<sustrik at moloch.sk> wrote:
>
>> There should be something about socket migration in zmq(7). Something like:
>> A socket can be migrated from one thread to another. When doing so, user is
>> responsible for executing full memory barrier. CAUTION: Do not use this
>> functionality unless you know exactly what you are doing.
>>
>> It's backwards compatible and has no direct relationship to ZMQ_FD or
>> ZMQ_EVENTS.
>>
>> Would you like to provide a documentation patch?
>
> Sure, but it's still unclear to me what 'migrated' actually means, in
> terms of functionality and/or use of the API. The "CAUTION" note
> doesn't really help, because unless the documentation explains exactly
> what this is, no-one can know exactly what they are doing with it...
> :-)
Migration means that you are using the socket from one thread, then you
start using it from other thread. In other words, you cannot use the
same socket from 2 threads in parallel, but you can stop using it in one
thread, then start using it from another one. The above is called
"migrating" the socket to another thread. When doing so you have to
ensure full memory barrier is executed.
> Please explain in plain English what socket migration is and how it
> works and how to use it, thanks. Then I'll make a patch for
> zmq_socket, where this should go.
Thanks!
Martin
More information about the zeromq-dev
mailing list