A summary for those who don't follow IRC: - POE keeps a priority queue of pending events - The current system time is used as the priority - If the system time is skewed (sysadmin, ntpd), events could happen at the "wrong time" An example of this problem would be calling
$poe_kernel->delay( something => 10 ); Then the sysadmin or ntpd moves the time 5 seconds back. The 'something' would be posted after 15 seconds, not 10 as expected. A pathelogical case is calling $poe_kernel->yield( 'something' ); And then the sytem time is moved 1 day back. The 'something' would only be delivered tomorrow! The included patch adds POE::Resource::Clock which uses POSIX::RT::Clock's 'monotonic' time source as the queue priority and the 'realtime' time source as the system time. However, some cheating has to be done; if converting from system time to monotonic time is not static, then the order following events are delivered is non-defined. $poe_kernel->alarm( one => $time ); $poe_kernel->alarm( two => $time ); This patch is not finale; it still needs to detect clock skew and adjust the queue priorities of alarms (but not delays or other events) when it happens. -Philip
POE-Resource-Clock.PG.01.patch
Description: POE-Resource-Clock.PG.01.patch