From 4a3b4dadead8fe2af65443d0be4cc8462b9aa597 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 2 Oct 2009 09:42:13 +0200 Subject: ZMQII-9: Check and implement speculative reads & writes --- src/zmq_engine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/zmq_engine.cpp') 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 () -- cgit v1.2.3