One thing you could do is work with ENet _exclusively_ on a separate thread. This way you can prevent issues with e.g., stuttering, or the rendering severely lowering the network's processing.<br><br><div class="gmail_quote">
2010/11/5 Nicholas J Ingrassellino <span dir="ltr"><<a href="mailto:nick@lifebloodnetworks.com">nick@lifebloodnetworks.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
With any game-- and most real-time applications, for that matter--
you will always want some kind of <i>rest(1)</i> (to rest ~one
millisecond). This saves CPU cycles, batteries, and makes fans less
noisey. My latest ENet game does it this way:<br>
<blockquote><i>while ( !_main_loop_exit ) {<br>
ššš while ( enet_host_service(client, &event, 0) > 0 ) {<br>
...<br>
ššš }<br>
<br>
ššš logic();<br>
ššš display();<br>
</i><i><br>
ššš rest(1);<br>
}<br>
</i></blockquote>
<br>
The biggest up side of ENet not wasting time waiting for something
to happen is other time-critic sections of code have a chance to do
something without having to wait (as is implied by this statement my
application is single-threaded). As long as the other code does not
take too long this allows ENet to check for a new events a hell of a
lot of times each second (as is bound by the CPU).<div class="im"><br>
<div><br>
<hr style="min-height: 1px;">
<p><span style="font-weight: bold;">Nicholas J Ingrassellino<br>
<a style="text-decoration: none;" href="http://www.lifebloodnetworks.com/" target="_blank">LifebloodNetworks.com</a></span>
|| <a style="text-decoration: none;" href="mailto:nick@lifebloodnetworks.com" target="_blank">nick@lifebloodnetworks.com</a></p>
<p style="font-size: 75%;">"<span style="font-style: italic;">The
idea that I can be presented with a problem, set out to
logically solve it with the tools at hand, and wind up with a
program that could not be legally used because someone else
followed the same logical steps some years ago and filed for a
patent on it is horrifying.</span>"<br>
- <span style="font-weight: bold;">John Carmack</span> on
software patents</p>
</div>
<br></div><div><div></div><div class="h5">
On 11/05/2010 12:28 PM, ÷ÑÞÅÓÌÁ× âÌÉÎÎÉËÏ× wrote:
<blockquote type="cite">
<pre>I tried to set "0" but in such case cycle with "enet_host_service()"
consumes 100% of processor's power.
I did not understood the phrase "I haven't noticed any performance
issues with ENet" - you meant that there is nothing faster then ENet?
5 ÎÏÑÂÒÑ 2010šÇ. 19:21 ÐÏÌØÚÏ×ÁÔÅÌØ Ruud van Gaal <a href="mailto:ruud@racer.nl" target="_blank"><ruud@racer.nl></a> ÎÁÐÉÓÁÌ:
</pre>
<blockquote type="cite">
<pre>I always use 0 for the enet_host_service() delay. And as for delays, I
haven't noticed any performance issues with ENet, although I'm doing a game
where framerate is very important.
Ruud
</pre>
</blockquote>
<pre>_______________________________________________
ENet-discuss mailing list
<a href="mailto:ENet-discuss@cubik.org" target="_blank">ENet-discuss@cubik.org</a>
<a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a>
</pre>
</blockquote>
</div></div></div>
<br>_______________________________________________<br>
ENet-discuss mailing list<br>
<a href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a><br>
<a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
<br></blockquote></div><br>