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

Comparing Coro/eg/prodcons2 (file contents):
Revision 1.4 by root, Sun Jul 15 02:35:52 2001 UTC vs.
Revision 1.5 by root, Mon Jul 23 02:14:19 2001 UTC

14async { 14async {
15 for my $i (0..9) { 15 for my $i (0..9) {
16 print "produced $i\n"; 16 print "produced $i\n";
17 push @buffer, $i; 17 push @buffer, $i;
18 $produced->up; 18 $produced->up;
19 yield if @buffer > 5; # simulate memory pressure ;) 19 cede if @buffer > 5; # simulate memory pressure ;)
20 } 20 }
21 print "work done\n"; 21 print "work done\n";
22 $finished->up; 22 $finished->up;
23}; 23};
24 24

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines