Skip to content

Commit

Permalink
Documentation wrt thread-safety cleaned up.
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Sustrik <[email protected]>
  • Loading branch information
sustrik authored and hintjens committed Mar 3, 2011
1 parent 1096070 commit c31d090
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
5 changes: 5 additions & 0 deletions doc/zmq_init.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ The 'io_threads' argument specifies the size of the 0MQ thread pool to handle
I/O operations. If your application is using only the 'inproc' transport for
messaging you may set this to zero, otherwise set it to at least one.

.Thread safety
A 0MQ 'context' is thread safe and may be shared among as many application
threads as necessary, without any additional locking required on the part of
the caller.


RETURN VALUE
------------
Expand Down
13 changes: 3 additions & 10 deletions doc/zmq_socket.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,9 @@ incoming connections *from multiple endpoints* bound to the socket using
_zmq_bind()_, thus allowing many-to-many relationships.

.Thread safety
A 0MQ 'context' is thread safe and may be shared among as many application
threads as necessary, without any additional locking required on the part of
the caller.

Individual 0MQ 'sockets' are _not_ thread safe except in the case where full
memory barriers are issued when migrating a socket from one thread to another.
In practice this means applications can create a socket in one thread with
_zmq_socket()_ and then pass it to a _newly created_ thread as part of thread
initialization, for example via a structure passed as an argument to
_pthread_create()_.
0MQ 'sockets' are _not_ thread safe. Applications MUST NOT use a socket
from multiple threads except after migrating a socket from one thread to
another with a "full fence" memory barrier.

.Socket types
The following sections present the socket types defined by 0MQ, grouped by the
Expand Down

0 comments on commit c31d090

Please sign in to comment.