aboutsummaryrefslogtreecommitdiff
path: root/devel/p5-Coro/pkg-descr
blob: 53257bedce150fd7919a9c7dc3ee11aa3449d9a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Coro started as a simple module that implemented a specific form of first class
continuations called Coroutines. These basically allow you to capture the
current point execution and jump to another point, while allowing you to return
at any time, as kind of non-local jump, not unlike C's setjmp/longjmp. This is
nowadays known as a Coro::State.

One natural application for these is to include a scheduler, resulting in
cooperative threads, which is the main use case for Coro today. Still, much of
the documentation and custom refers to these threads as "coroutines" or often
just "coros".

A thread is very much like a stripped-down perl interpreter, or a process:
Unlike a full interpreter process, a thread doesn't have its own variable or
code namespaces - everything is shared. That means that when one thread modifies
a variable (or any value, e.g. through a reference), then other threads
immediately see this change when they look at the same variable or location.

WWW: https://metacpan.org/release/Coro