Scroll to navigation

MCE::Util(3pm) User Contributed Perl Documentation MCE::Util(3pm)
 

NAME

MCE::Util - Public and private utility functions for Many-core Engine

VERSION

This document describes MCE::Util version 1.517

SYNOPSIS

 use MCE::Util;

DESCRIPTION

A utility module for MCE. Nothing is exported by default. Exportable is get_ncpu.

get_ncpu()

Returns the number of logical (online/active/enabled) CPU cores; never smaller than one.
 my $ncpu = MCE::Util::get_ncpu();
Specifying 'auto' for max_workers calls MCE::Util::get_ncpu automatically.
 use MCE;
 my $mce = MCE->new(
   max_workers => 'auto-1',        ## MCE::Util::get_ncpu() - 1
   max_workers => 'auto+3',        ## MCE::Util::get_ncpu() + 3
   max_workers => 'auto',          ## MCE::Util::get_ncpu()
 );

ACKNOWLEDGEMENTS

The portable code for detecting the number of processors was adopted from Test::Smoke::SysInfo.

INDEX

MCE

AUTHOR

Mario E. Roy, <marioeroy AT gmail DOT com>

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See <http://dev.perl.org/licenses/> for more information.
2014-10-24 perl v5.20.1