[zeromq-dev] Whcih API calls are thread safe ?

john skaller skaller at users.sourceforge.net
Sun Jan 22 15:57:59 CET 2012


On 22/01/2012, at 7:28 PM, Marten Feldtmann wrote:

> I would like to know, which APi calls can be used by different threads ?
> 
> I assume, that ALL socket oriented calls MUST be called from the thread, 
> which created the socket.

That's not my understanding: the API notes say that a socket isn't thread safe,
and a memory barrier must be used. Which implies it can be used on any thread
provided you organise locking or whatever.

Posix is rather crappy here, but mutex locks also synchronise memory.
Unfortunate, results in woeful performance. [A mutex lock operation has
no idea what's being locked so the WHOLE of memory has to be synchronised]


--
john skaller
skaller at users.sourceforge.net







More information about the zeromq-dev mailing list