[zeromq-dev] Notes from a hackathon
Andreas Schultz
aschultz at tpip.net
Thu Feb 5 10:21:20 CET 2015
Hi,
----- On 2 Feb, 2015, at 10:23, Pieter Hintjens ph at imatix.com wrote:
[...]
> Multipart messages are the main reason we can't make threadsafe sockets.
Well, yes and no. The API the 0MQ use for multipart messages is the main
reason that you can't make threadsafe sockets, because the API
does not have a atomic send/recv operation for multipart messages.
Having to call the send/recv operation multiple times to process
multipart messages creates a serialization problem and also necessitates
in socket buffering, thus creating a concurrency problem for multi
part messages (not that it is impossible to solve, adding a per thread
buffers shouldn't be too difficult). The socket buffering is also likely
the reason that the performance drops (because of the additional copying).
Doing multipart messages with an atomic, sendmsg like API, would be
much simpler. The 0MQ library could convert the 0MQ socket API call
into an real sendmsg call without having to copy the parts around.
Andreas
[...]
> Cheers
> Pieter
More information about the zeromq-dev
mailing list