Is there a good way of interacting between those two libraries?
I'm trying to mix two single threaded libraries - one built for each
platform. It's simple to poll each library but this this seems to mean
either introducing a sleep in the loop of spinning a full speed.
a naive approach...
....
while (true)
{
// does not block but might handle several events
int s1 = event_base_loop(_event_base, EVLOOP_NONBLOCK);
// handles at most 1 event
size_t n = ios.poll();
if (n>0)
continue;
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
}
Is there a way of waiting for both sets of file descriptors so I don't have
to rely on the timer or a busy loop to poll both events?
I know I can have one thread running the libevent queue and another the
boost::asio eventloop but that gives problems when the callbacks in each
subsystem calls the other.
I'm familiar with boost but not libevent so please bear with me if this
question is trivial in libevent context...
/svante