[zeromq-dev] Thread Safe sockets
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...
More information about the zeromq-dev