[ENet-discuss] wake-up enet service

Ruud van Gaal ruud at racer.nl
Thu Aug 2 14:02:32 PDT 2012


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 <japplegame at gmail.com> 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 <japplegame at gmail.com>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
>> ENet-discuss at cubik.org
>> http://lists.cubik.org/mailman/listinfo/enet-discuss
>>
>
>
>
> _______________________________________________
> ENet-discuss mailing listENet-discuss at cubik.orghttp://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20120802/9e81d979/attachment.html>


More information about the ENet-discuss mailing list