diff options
author | Sergei Fedosoff <eleksir@gmail.com> | 2019-04-12 21:54:16 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2019-04-12 21:55:29 +0700 |
commit | 67f5f857da5ff0c6068c05b9af4052ca76815544 (patch) | |
tree | e95268e5a93d4f25e9b5e10276b4d2636e6f5b87 /perl/perl-Coro/README | |
parent | f32d8562330769afef5d1b46f9b6d4bc7bc75c06 (diff) | |
download | slackbuilds-67f5f857da5ff0c6068c05b9af4052ca76815544.tar.gz |
perl/perl-Coro: Added (the only real threads in perl).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'perl/perl-Coro/README')
-rw-r--r-- | perl/perl-Coro/README | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/perl/perl-Coro/README b/perl/perl-Coro/README new file mode 100644 index 0000000000..829b494763 --- /dev/null +++ b/perl/perl-Coro/README @@ -0,0 +1,32 @@ +This module collection manages continuations in general, most often in +the form of cooperative threads (also called coros, or simply "coro" in +the documentation). They are similar to kernel threads but don't (in +general) run in parallel at the same time even on SMP machines. The +specific flavor of thread offered by this module also guarantees you +that it will not switch between threads unless necessary, at +easily-identified points in your program, so locking and parallel access +are rarely an issue, making thread programming much safer and easier than +using other thread models. + +Unlike the so-called "Perl threads" (which are not actually real threads +but only the windows process emulation (see section of same name for more +details) ported to UNIX, and as such act as processes), Coro provides a +full shared address space, which makes communication between threads very +easy. And coro threads are fast, too: disabling the Windows process +emulation code in your perl and using Coro can easily result in a two to +four times speed increase for your programs. A parallel matrix +multiplication benchmark (very communication-intensive) runs over 300 +times faster on a single core than perls pseudo-threads on a quad core +using all four cores. + +Coro achieves that by supporting multiple running interpreters that share +data, which is especially useful to code pseudo-parallel processes and for +event-based programming, such as multiple HTTP-GET requests running +concurrently. See Coro::AnyEvent to learn more on how to integrate Coro +into an event-based environment. + +In this module, a thread is defined as "callchain + lexical variables + +some package variables + C stack), that is, a thread has its own +callchain, its own set of lexicals and its own set of perls most +important global variables (see Coro::State for more configuration and +background info). |