ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro-Multicore/Multicore.pm
(Generate patch)

Comparing Coro-Multicore/Multicore.pm (file contents):
Revision 1.3 by root, Sat Jun 27 19:59:58 2015 UTC vs.
Revision 1.4 by root, Sun Jun 28 17:39:42 2015 UTC

39 use Coro::Multicore; 39 use Coro::Multicore;
40 40
41This module has no important API functions to learn or remember. All you 41This module has no important API functions to learn or remember. All you
42need to do is I<load> it before you can take advantage of it. 42need to do is I<load> it before you can take advantage of it.
43 43
44=head1 API FUNCTION 44=head1 API FUNCTIONS
45
46There is currently a lone API function documented for this module:
47 45
48=over 4 46=over 4
47
48=item $previous = Coro::Multicore::enable [$enable]
49
50This function enables (if C<$enable> is true) or disables (if C<$enable>
51is false) the multicore functionality globally. By default, it is enabled.
52
53This can be used to effectively disable this module's functionality by
54default, and enable it only for selected threads or scopes, by calling
55C<Coro::Multicore::scope_enable>.
56
57The function returns the previous value of the enable flag.
58
59=item Coro::Multicore::scoped_enable
60
61This function instructs Coro::Multicore to handle all requests executed
62in the current coro thread, from the call to the end of the current scope.
63
64Calls to C<scoped_enable> and C<scoped_disable> don't nest very well at
65the moment, so don't nest them.
66
67=item Coro::Multicore::scoped_disable
68
69The opposite of C<Coro::Multicore::scope_disable>: instructs Coro::Multicore to
70I<not> handle the next multicore-enabled request.
49 71
50=item $previous = Coro::Multicore::max_idle_threads [$count] 72=item $previous = Coro::Multicore::max_idle_threads [$count]
51 73
52To run on multiple cores, this module creates I<threads>. Since thread 74To run on multiple cores, this module creates I<threads>. Since thread
53creation is costly, it will keep some of them around for future uses. This 75creation is costly, it will keep some of them around for future uses. This

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines