ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-scheduler.ext
(Generate patch)

Comparing deliantra/server/ext/map-scheduler.ext (file contents):
Revision 1.45 by root, Thu Oct 11 00:34:31 2007 UTC vs.
Revision 1.46 by root, Wed Nov 14 08:09:46 2007 UTC

53}; 53};
54 54
55our $SCHEDULER = cf::async_ext { 55our $SCHEDULER = cf::async_ext {
56 $Coro::current->{desc} = "map scheduler"; 56 $Coro::current->{desc} = "map scheduler";
57 $Coro::current->prio (Coro::PRIO_MAX); 57 $Coro::current->prio (Coro::PRIO_MAX);
58 my $timer = Coro::Event->timer (data => cf::WF_AUTOCANCEL);
59 58
60 while () { 59 while () {
61 if ($cf::LOADAVG > $SWAP_LOAD2) { 60 if ($cf::LOADAVG > $SWAP_LOAD2) {
62 $timer->interval (0.05); 61 Coro::EV::timer_once 0.05;
63 $timer->next;
64 cf::wait_for_tick; 62 cf::wait_for_tick;
65 } else { 63 } else {
66 $timer->interval ($SCHEDULE_INTERVAL); 64 Coro::EV::timer_once $SCHEDULE_INTERVAL;
67 $timer->next;
68 } 65 }
69 66
70 # this weird form of iteration over values is used because 67 # this weird form of iteration over values is used because
71 # the hash changes underneath us frequently, and for 68 # the hash changes underneath us frequently, and for
72 # keeps a direct reference to the value without (in 5.8 perls) 69 # keeps a direct reference to the value without (in 5.8 perls)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines