ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro.pm
(Generate patch)

Comparing Coro/Coro.pm (file contents):
Revision 1.249 by root, Mon Dec 15 15:21:25 2008 UTC vs.
Revision 1.250 by root, Wed Dec 17 04:57:07 2008 UTC

427 427
428This ensures that the scheduler will resume this coro automatically 428This ensures that the scheduler will resume this coro automatically
429once all the coro of higher priority and all coro of the same 429once all the coro of higher priority and all coro of the same
430priority that were put into the ready queue earlier have been resumed. 430priority that were put into the ready queue earlier have been resumed.
431 431
432=item $coro->suspend
433
434Suspends the specified coro. A suspended coro works just like any other
435coro, except that the scheduler will not select a suspended coro for
436execution.
437
438Suspending a coro can be useful when you want to keep the coro from
439running, but you don't want to destroy it, or when you want to temporarily
440freeze a coro (e.g. for debugging) to resume it later.
441
442A scenario for the former would be to suspend all (other) coros after a
443fork and keep them alive, so their destructors aren't called, but new
444coros can be created.
445
446=item $coro->resume
447
448If the specified coro was suspended, it will be resumed. Note that when
449the coro was in the ready queue when it was suspended, it might have been
450unreadied by the scheduler, so an activation might have been lost.
451
452To avoid this, it is best to put a suspended coro into the ready queue
453unconditionally, as every synchronisation mechanism must protect itself
454against spurious wakeups, and the one in the Coro family certainly do
455that.
456
432=item $is_ready = $coro->is_ready 457=item $is_ready = $coro->is_ready
433 458
434Returns true iff the Coro object is in the ready queue. Unless the Coro 459Returns true iff the Coro object is in the ready queue. Unless the Coro
435object gets destroyed, it will eventually be scheduled by the scheduler. 460object gets destroyed, it will eventually be scheduled by the scheduler.
436 461

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines