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

Comparing Coro/Coro.pm (file contents):
Revision 1.97 by root, Mon Dec 4 13:47:56 2006 UTC vs.
Revision 1.98 by root, Mon Dec 4 21:56:00 2006 UTC

18 18
19 cede; 19 cede;
20 20
21=head1 DESCRIPTION 21=head1 DESCRIPTION
22 22
23This module collection manages coroutines. Coroutines are similar to 23This module collection manages coroutines. Coroutines are similar
24threads but don't run in parallel. 24to threads but don't run in parallel at the same time even on SMP
25machines. The specific flavor of coroutine use din this module also
26guarentees you that it will not switch between coroutines unless
27necessary, at easily-identified points in your program, so locking and
28parallel access are rarely an issue, making coroutine programming much
29safer than threads programming.
25 30
31(Perl, however, does not natively support real threads but instead does a
32very slow and memory-intensive emulation of processes using threads. This
33is a performance win on Windows machines, and a loss everywhere else).
34
26In this module, coroutines are defined as "callchain + lexical variables 35In this module, coroutines are defined as "callchain + lexical variables +
27+ @_ + $_ + $@ + $^W + C stack), that is, a coroutine has it's own 36@_ + $_ + $@ + $/ + C stack), that is, a coroutine has its own callchain,
28callchain, it's own set of lexicals and it's own set of perl's most 37its own set of lexicals and its own set of perls most important global
29important global variables. 38variables.
30 39
31=cut 40=cut
32 41
33package Coro; 42package Coro;
34 43
41 50
42our $idle; # idle handler 51our $idle; # idle handler
43our $main; # main coroutine 52our $main; # main coroutine
44our $current; # current coroutine 53our $current; # current coroutine
45 54
46our $VERSION = '3.01'; 55our $VERSION = '3.1';
47 56
48our @EXPORT = qw(async cede schedule terminate current unblock_sub); 57our @EXPORT = qw(async cede schedule terminate current unblock_sub);
49our %EXPORT_TAGS = ( 58our %EXPORT_TAGS = (
50 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], 59 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)],
51); 60);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines