On Dec 15, 2005, at 9:51 PM, Bulat Ziganshin wrote:
if half-second precision of performing events is appropriate for you,
why don't use solution which holds all events for given second in one
list? you can use array of such lists, or map of lists, or even
ordered list of lists - it will contain
Hello Joel,
Thursday, December 15, 2005, 2:42:03 PM, you wrote:
JR> Here's the latest and greatest version put together with Einar's help.
let's analyze execution of this thread. it has 2000-6000 events in his
Map with an expiration time in the range 0-60 sec. it sleeps half a second,
then wakes
Here's the latest and greatest version put together with Einar's help.
The seconds portion of ClockTime and a counter are used as the key
now and the counter wraps around. This would make two distinct timers
even if there expiration times were the same.
{-# OPTIONS_GHC -fglasgow-exts -fno-c