… | |
… | |
18 | |
18 | |
19 | yield; |
19 | yield; |
20 | |
20 | |
21 | =head1 DESCRIPTION |
21 | =head1 DESCRIPTION |
22 | |
22 | |
|
|
23 | This module collection manages coroutines. Coroutines are similar to |
|
|
24 | Threads but don't run in parallel. |
|
|
25 | |
|
|
26 | This module is still experimental, see the BUGS section below. |
|
|
27 | |
23 | =cut |
28 | =cut |
24 | |
29 | |
25 | package Coro; |
30 | package Coro; |
26 | |
31 | |
27 | use Coro::State; |
32 | use Coro::State; |
28 | |
33 | |
29 | use base Exporter; |
34 | use base Exporter; |
30 | |
35 | |
31 | $VERSION = 0.05; |
36 | $VERSION = 0.06; |
32 | |
37 | |
33 | @EXPORT = qw(async yield schedule terminate); |
38 | @EXPORT = qw(async yield schedule terminate); |
34 | @EXPORT_OK = qw($current); |
39 | @EXPORT_OK = qw($current); |
35 | |
40 | |
36 | { |
41 | { |
… | |
… | |
216 | |
221 | |
217 | =cut |
222 | =cut |
218 | |
223 | |
219 | 1; |
224 | 1; |
220 | |
225 | |
|
|
226 | =head1 BUGS |
|
|
227 | |
|
|
228 | - could be faster, especially when the core would introduce special |
|
|
229 | support for coroutines (like it does for threads). |
|
|
230 | - there is still a memleak on coroutine termination that I could not |
|
|
231 | identify. Could be as small as a single SV. |
|
|
232 | - this module is not well-tested. |
|
|
233 | |
221 | =head1 SEE ALSO |
234 | =head1 SEE ALSO |
222 | |
235 | |
223 | L<Coro::Channel>, L<Coro::Cont>, L<Coro::Specific>, L<Coro::Semaphore>, |
236 | L<Coro::Channel>, L<Coro::Cont>, L<Coro::Specific>, L<Coro::Semaphore>, |
224 | L<Coro::Signal>, L<Coro::State>, L<Coro::Event>. |
237 | L<Coro::Signal>, L<Coro::State>, L<Coro::Event>. |
225 | |
238 | |