[bf1942] v1.3

Scratch Monkey ScratchMonkey at SewingWitch.com
Tue Feb 11 02:17:26 EST 2003


--On Monday, February 10, 2003 6:19 AM -0500 "Ryan C. Gordon"
<icculus at clutteredmind.org> wrote:

> Might be part of fixing the ping, I'm kinda playing with how the server
> sleeps now (select() on socket instead of an actual sleep() call). Looks
> like I'm still eating a little too much CPU and some things are going too
> fast (not enough sleep each frame means that frame processing happens
> quicker which means things speed up).

Great news on switching to select! Thanks!

You might throttle the speed by averaging your frame response over time. If
you wake because of handle activity and not a timeout, note whether you've
already processed the frame for this interval (ie. record a timestamp when
you do process a frame) and blow it off until next time if so, adjusting
your select timeout. Use absolute time measurements to know when you need
to timeout next. (Hopefully I stated that in a form you can decrypt. I'm a
little sleep-deprived myself as I write this. ;) )



More information about the Bf1942 mailing list