… | |
… | |
15 | |
15 | |
16 | This module can be used to create variables (or better: references to |
16 | This module can be used to create variables (or better: references to |
17 | them) that are specific to the currently executing coroutine. This module |
17 | them) that are specific to the currently executing coroutine. This module |
18 | does not automatically load the Coro module (so the overhead will be small |
18 | does not automatically load the Coro module (so the overhead will be small |
19 | when no coroutines are used). |
19 | when no coroutines are used). |
|
|
20 | |
|
|
21 | A much faster method is to store extra keys into C<%$Coro::current> |
|
|
22 | - all you have to do is to make sure that the key is unique (e.g. by |
|
|
23 | prefixing it with your module name). You can even store data there before |
|
|
24 | loading the L<Coro> module - when Coro is loaded, the keys stored in |
|
|
25 | C<%$Coro::current> are automatically attached to the coro thread executing |
|
|
26 | the main program. |
|
|
27 | |
|
|
28 | You don't have to load C<Coro::Specific> manually, it will be loaded |
|
|
29 | automatically when you C<use Coro> and call the C<new> constructor. |
20 | |
30 | |
21 | =over 4 |
31 | =over 4 |
22 | |
32 | |
23 | =cut |
33 | =cut |
24 | |
34 | |