summaryrefslogtreecommitdiff
path: root/src/signaler.cpp
AgeCommit message (Collapse)Author
2011-07-18Fix pollin on Cygwin.Steven McCoy
Signed-off-by: Steven McCoy <steven.mccoy@miru.hk> Signed-off-by: Martin Sustrik <sustrik@250bom.com>
2011-07-18Signaler timeout bug on Windows fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-03Merge branch 'master' of github.com:zeromq/libzmqMartin Sustrik
2011-07-03Race condition in eventfd signaler fixedMartin Sustrik
recv function on eventfd signaler could accidentally grab two signals instead of one. Fixed. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-03eventfd implementation of the signalerMartin Sustrik
Eventfd (on Linux) is more efficient that socketpair for passing simple signals. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-03Fix MSVC buildMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-03Command are now stored in ypipes instead of in socketpairsMartin Sustrik
Storing commands in OS socket buffers caused whole lot of problems when free space in the buffer ran out. This patch stores commands in ypipes instead and uses socketpair just to signal the other thread, ie. at most one byte is stored in the socketpair at any single instant. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-11-05signaler renamed to mailboxMartin Sustrik
For historical reasons queue to transfer commands between threads was called 'signaler'. Given that it was used to pass commands rather than signals it was renamed to 'mailbox', see Erlang mailboxes. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-11-04Automatically resize signalling socket buffer if fullMartin Lucina
If the socketpair used by signaler_t fills up, this can lead to deadlock. This patch provides partial resolution by attempting to resize SO_SNDBUF on the writer side, and if that fails we shall at least assert rather than hang. I've also refactored the signaler_t code to make the platform-dependent parts clearer and have tested both the MSG_DONTWAIT and standard POSIX path in recv. The Win32 implementation currently does not implement resizing as I'm not convinced that it's safe, but it will also assert like other platforms if signaler_t::send() cannot succeed. The OpenVMS implementation has been carried forward but is untested. Signed-off-by: Martin Lucina <mato@kotelna.sk>
2010-10-30Name of "GNU Lesser Public License" corrected.Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-08Scalability improvements for large amounts of connectionsMartin Lucina
Add signaler_sndbuf_size option to config.hpp which allows the user to increase the size of the send buffer used by the signalling socketpair. Implement random backoff for reconnection attempts using a primitive pseudo-random generation to prevent reconnection storms. Add wait_before_connect option to config.hpp to allow the user to enable random delay even on initial connect. Default is false for low latency. Signed-off-by: Martin Lucina <mato@kotelna.sk>
2010-09-08EINTR returned from the blocking functionsMartin Sustrik
2010-09-02Fix for signaler_t on HP-UX and AIX platformsBernd Melchers
2010-08-06Fix uninitialized use of nbytes in signaler fixMartin Lucina
2010-08-05zmq::signaler_t: Restart syscalls on EINTRMartin Lucina
This patch restarts the send() or recv() inside zmq::signaler_t if the call fails due to EINTR.
2010-05-12fixes for OpenVMSBrett Cameron
2010-05-04Windows port fixedMartin Sustrik
2010-05-04signaler transports commands per se rather than one-bit signalsMartin Sustrik
2010-04-29windows port fixedMartin Sustrik
2010-04-29signaler rewritten in such a way that any number (>64) of threads can be usedMartin Sustrik
2010-04-29eventfd-style signaling removedMartin Sustrik
2010-04-29fd_signaler_t renamed to signaler_tMartin Sustrik