Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
8004c10f
Commit
8004c10f
authored
Jan 19, 2020
by
std-any-emplace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation fix regarding thread-safety of zmq_poll/zmq_poller.txt.
See
https://github.com/zeromq/libzmq/issues/3778
.
parent
1b8a3524
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
zmq_poll.txt
doc/zmq_poll.txt
+10
-0
zmq_poller.txt
doc/zmq_poller.txt
+9
-2
No files found.
doc/zmq_poll.txt
View file @
8004c10f
...
@@ -80,6 +80,16 @@ NOTE: The _zmq_poll()_ function may be implemented or emulated using operating
...
@@ -80,6 +80,16 @@ NOTE: The _zmq_poll()_ function may be implemented or emulated using operating
system interfaces other than _poll()_, and as such may be subject to the limits
system interfaces other than _poll()_, and as such may be subject to the limits
of those interfaces in ways not defined in this documentation.
of those interfaces in ways not defined in this documentation.
THREAD SAFETY
-------------
The *zmq_pollitem_t* array must only be used by the thread which
will/is calling _zmq_poll_.
If a socket is contained in multiple *zmq_pollitem_t* arrays, each owned by a
different thread, the socket itself needs to be thead-safe (Server, Client, ...).
Otherwise, behaviour is undefined.
RETURN VALUE
RETURN VALUE
------------
------------
Upon successful completion, the _zmq_poll()_ function shall return the number
Upon successful completion, the _zmq_poll()_ function shall return the number
...
...
doc/zmq_poller.txt
View file @
8004c10f
...
@@ -56,8 +56,11 @@ In addition, _user_data_ may be specified, which is not used by the poller, but
...
@@ -56,8 +56,11 @@ In addition, _user_data_ may be specified, which is not used by the poller, but
passed back to the caller when an event was signalled in a call to
passed back to the caller when an event was signalled in a call to
_zmq_poller_wait_ or _zmq_poller_wait_all_. _user_data_ may be NULL. If it is
_zmq_poller_wait_ or _zmq_poller_wait_all_. _user_data_ may be NULL. If it is
not NULL, it must be a valid pointer. Otherwise, behaviour is undefined.
not NULL, it must be a valid pointer. Otherwise, behaviour is undefined.
_zmq_poller_add_ may not be called multiple times for the same socket
You must only add a socket to a single poller instance once (unless
(unless _zmq_poller_remove_ has been called for that socket).
_zmq_poller_remove_ has been called for that socket before). You may
add a socket to multiple poller instances, if the socket itself
is explicitly thread-safe (Server, Client, ...). If the socket is not,
you may invoke undefined behavior.
_zmq_poller_modify_ modifies the subscribed events for a socket. It is
_zmq_poller_modify_ modifies the subscribed events for a socket. It is
legal to specify no events (i.e. 0) to disable events temporarily, and
legal to specify no events (i.e. 0) to disable events temporarily, and
...
@@ -183,6 +186,10 @@ THREAD SAFETY
...
@@ -183,6 +186,10 @@ THREAD SAFETY
Like most other 0MQ objects, a poller is not thread-safe. All operations must
Like most other 0MQ objects, a poller is not thread-safe. All operations must
be called from the same thread. Otherwise, behaviour is undefined.
be called from the same thread. Otherwise, behaviour is undefined.
In addition to that, if you want to add a socket to multiple existing poller
instances, the socket itself needs to be thread-safe (Server, Client, ...).
Otherwise, behaviour is undefined.
RETURN VALUE
RETURN VALUE
------------
------------
_zmq_poller_new_ returns a valid pointer to a poller, or NULL in case of a failure.
_zmq_poller_new_ returns a valid pointer to a poller, or NULL in case of a failure.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment