Coro is a large Perl module family that implements cooperative multitasking in Perl.
Version: 4.73Coro is a large Perl module family that implements cooperative multitasking in Perl. It supports filehandle and event abstraction and also implements continuations as well as the necessary directives to implement a slightly limited call/cc in Perl.
License: Perl Artistic License
Operating System: Linux
Unlike the so-called "Perl threads/fork emulation", they provide a real shared address space (like real threads) without the associated race conditions and performance loss, while maintaining a very low memory overhead (2-3kb/coroutine). The package comes with examples and many supporting modules.
# some asynchronous thread of execution
cede; # yield back to main
cede; # yield to coroutine
cede; # and again
# use locking
my $lock = new Coro::Semaphore;
$locked = 1;