mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-09 15:26:04 +00:00
ZMQII-9: Check and implement speculative reads & writes
This commit is contained in:
parent
49a9ef5fcb
commit
4a3b4dadea
@ -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 ();
|
||||
|
@ -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 ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user