That's why I use timeout=0 and deal with thread waiting (to avoid polling the core to 100%) myself using the OS. A Sleep(1) already does wonders.
Ruud On Thu, Aug 2, 2012 at 8:57 PM, Jack Applegame <[email protected]> wrote: > I check ENet sources and found that it uses blocking(synchronous) socket > operations. This means there is no way to wake-up waiting thread without > serious modification of sources. :( > > 02.08.2012 12:13, Ruud van Gaal wrote: > > I'd always use timeout=0, except for really simple apps perhaps. > As for waking up threads then, it's just standard OS things (not related > to ENet); check out semaphores and waitable objects. > > Cheers, > Ruud > > > On Thu, Aug 2, 2012 at 8:58 AM, Jack Applegame <[email protected]>wrote: > >> Hello! >> >> I use separate thread for calling enet_host_service() with 1 second >> timeout. >> Is there a way to wake-up ENet from other thread, if It is necessary to >> send a packet immediately without waiting for timeout? >> Setting timeout to zero isn't good way, because in this case service >> thread fully loads one processor core even if it is no network activity. >> >> Best regards >> Jack Applegame >> _______________________________________________ >> ENet-discuss mailing list >> [email protected] >> http://lists.cubik.org/mailman/listinfo/enet-discuss >> > > > > _______________________________________________ > ENet-discuss mailing > [email protected]http://lists.cubik.org/mailman/listinfo/enet-discuss > > > > _______________________________________________ > ENet-discuss mailing list > [email protected] > http://lists.cubik.org/mailman/listinfo/enet-discuss > >
_______________________________________________ ENet-discuss mailing list [email protected] http://lists.cubik.org/mailman/listinfo/enet-discuss
