From 235ed3a3dcffb7c658cbc9253eae9de54db24533 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 4 May 2010 10:22:16 +0200 Subject: signaler transports commands per se rather than one-bit signals --- src/io_thread.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/io_thread.cpp') diff --git a/src/io_thread.cpp b/src/io_thread.cpp index b38f58c..92c314a 100644 --- a/src/io_thread.cpp +++ b/src/io_thread.cpp @@ -22,10 +22,8 @@ #include "../include/zmq.h" #include "io_thread.hpp" -#include "command.hpp" #include "platform.hpp" #include "err.hpp" -#include "command.hpp" #include "dispatcher.hpp" zmq::io_thread_t::io_thread_t (dispatcher_t *dispatcher_, @@ -67,17 +65,18 @@ int zmq::io_thread_t::get_load () void zmq::io_thread_t::in_event () { + // TODO: Do we want to limit number of commands I/O thread can + // process in a single go? + while (true) { - // Get the next signal. - uint32_t signal = signaler.check (); - if (signal == signaler_t::no_signal) + // Get the next command. If there is none, exit. + command_t cmd; + if (!signaler.recv (&cmd, false)) break; - // Process all the commands from the thread that sent the signal. - command_t cmd; - while (get_dispatcher ()->read (signal, get_thread_slot (), &cmd)) - cmd.destination->process_command (cmd); + // Process the command. + cmd.destination->process_command (cmd); } } -- cgit v1.2.3