summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-10-02 09:42:13 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-10-02 09:42:13 +0200
commit4a3b4dadead8fe2af65443d0be4cc8462b9aa597 (patch)
tree866ac26898776c4b03124e7deaa35dc34a231ee5 /src
parent49a9ef5fcb661827ee174415b4608e609bd0a65b (diff)
ZMQII-9: Check and implement speculative reads & writes
Diffstat (limited to 'src')
-rw-r--r--src/ypollset.cpp1
-rw-r--r--src/zmq_engine.cpp6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ypollset.cpp b/src/ypollset.cpp
index 4e73361..0f0d75f 100644
--- a/src/ypollset.cpp
+++ b/src/ypollset.cpp
@@ -29,7 +29,6 @@ zmq::ypollset_t::~ypollset_t ()
void zmq::ypollset_t::signal (int signal_)
{
-printf ("++signal\n");
zmq_assert (signal_ >= 0 && signal_ < wait_signal);
if (bits.btsr (signal_, wait_signal))
sem.post ();
diff --git a/src/zmq_engine.cpp b/src/zmq_engine.cpp
index b82af0a..baa0eee 100644
--- a/src/zmq_engine.cpp
+++ b/src/zmq_engine.cpp
@@ -137,6 +137,12 @@ void zmq::zmq_engine_t::out_event ()
void zmq::zmq_engine_t::revive ()
{
set_pollout (handle);
+
+ // Speculative write: The assumption is that at the moment new message
+ // was sent by the user the socket is probably available for writing.
+ // Thus we try to write the data to socket avoiding polling for POLLOUT.
+ // Consequently, the latency should be better in request/reply scenarios.
+ out_event ();
}
void zmq::zmq_engine_t::error ()