Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Concurrent-computing/Perl/concurrent-computing-1.pl
Normal file
9
Task/Concurrent-computing/Perl/concurrent-computing-1.pl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use threads;
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
$_->join for map {
|
||||
threads->create(sub {
|
||||
sleep rand;
|
||||
print shift, "\n";
|
||||
}, $_)
|
||||
} qw(Enjoy Rosetta Code);
|
||||
10
Task/Concurrent-computing/Perl/concurrent-computing-2.pl
Normal file
10
Task/Concurrent-computing/Perl/concurrent-computing-2.pl
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
use feature qw( say );
|
||||
use Coro;
|
||||
use Coro::Timer qw( sleep );
|
||||
|
||||
$_->join for map {
|
||||
async {
|
||||
sleep rand;
|
||||
say @_;
|
||||
} $_
|
||||
} qw( Enjoy Rosetta Code );
|
||||
Loading…
Add table
Add a link
Reference in a new issue