Compute bound loops seem common to many applications which have to
do a good amount of compression, encryption, sorting, math crunching,
recursive game tree analysis, etc.  How to best handle this when a large
amount of local state has to be set up and torn down between time limited
compute chunks is an interesting question.

Since humans won't notice a few ticks of delay, one possibility is to only
check TimGetTicks() every few times through a compute loop, and then
stay in the compute loop until at least N ticks have passed since the last
event poll.  But what would be the recommended value for N?  (for
non-action-game apps, where I assume the optimal answer is a small
single-digit integer related to the display refresh rate.)  For non-game
apps, is 10 times per second sufficient?  Twice per second?  Or?

Also, I wasn't sure from the documentation: does EvtGetPen() update its
return value even if there are no intervening calls to EvtGetEvent()?
If so, it might be possible to poll EvtGetPen() inside a compute loop,
and not break out to the event-loop unless some potential user interaction
has been detected by a pendown, or to periodically handle system events.
But how often should system events be polled during a user requested
compute bound algorithm?

Thanks,

Ron Nicholson
HotPaw Productions
 <http://www.hotpaw.com/rhn/hotpaw> 

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to