Attached is a patch to the reference manual that documents socket migration.


-
Pieter Hintjens
iMatix - www.imatix.com
From 5f2367ce0b23c25e29b694696443cad1b790aea7 Mon Sep 17 00:00:00 2001
From: Pieter Hintjens <[email protected]>
Date: Mon, 11 Oct 2010 18:56:25 +0200
Subject: [PATCH] Added note on socket migration

Signed-off-by: Pieter Hintjens <[email protected]>
---
 doc/zmq_socket.txt |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/doc/zmq_socket.txt b/doc/zmq_socket.txt
index 2156af2..c4f5ac6 100644
--- a/doc/zmq_socket.txt
+++ b/doc/zmq_socket.txt
@@ -46,6 +46,12 @@ relationships. With the exception of 'ZMQ_PAIR', 0MQ sockets may be connected
 incoming connections *from multiple endpoints* bound to the socket using
 _zmq_bind()_, thus allowing many-to-many relationships.
 
+.Thread safety
+0MQ sockets are not threadsafe. You can create a socket in one thread and use
+it in a second thread, passing it at thread creation time, via a structure.
+You should not read or write the same socket from multiple threads unless
+you can ensure the necessary full memory barriers.
+
 .Socket types
 The following sections present the socket types defined by 0MQ, grouped by the
 general _messaging pattern_ which is built from related socket types.
-- 
1.7.0.4

_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to