[zeromq-dev] Thread Safe sockets
Nadav Samet
thesamet at gmail.com
Tue Feb 7 10:41:46 CET 2012
>
>
> How readable is that? And what about the global variables? etc.
>
>
I absolutely agree that recv() is more readable than using callbacks, but
it has the undesirable characteristic that it blocks the calling thread
until the response arrives... Imagine an RPC server A with a few worker
threads that in order to process a request from a client it needs to make a
request to another server B. Having a worker thread on server A blocking on
recv() from a socket that is connected to server B will hurt performance.
The waiting thread could have been serving other requests while it has been
waiting inside recv().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120207/f97b4c9d/attachment.htm>
More information about the zeromq-dev
mailing list