.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Processors 3pm" .TH Processors 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Unix::Processors \- Interface to processor (CPU) information .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Unix::Processors; \& \& my $procs = new Unix::Processors; \& print "There are ", $procs\->max_online, " CPUs at ", $procs\->max_clock, "\en"; \& if ($procs\->max_online != $procs\->max_physical) { \& print "Hyperthreading between ",$procs\->max_physical," physical CPUs.\en"; \& } \& (my $FORMAT = "%2s %\-8s %4s \en") =~ s/\es\es+/ /g; \& printf($FORMAT, "#", "STATE", "CLOCK", "TYPE", ); \& foreach my $proc (@{$procs\->processors}) { \& printf ($FORMAT, $proc\->id, $proc\->state, $proc\->clock, $proc\->type); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This package provides accessors to per-processor (\s-1CPU\s0) information. The object is obtained with the Unix::Processors::processors call. the operating system in a \s-1OS\s0 independent manner. .IP "max_online" 4 .IX Item "max_online" Return number of threading processors currently online. On hyperthreaded Linux systems, this indicates the maximum number of simultaneous threads that may execute; see max_physical for the real physical \s-1CPU\s0 count. .IP "max_physical" 4 .IX Item "max_physical" Return number of physical processor cores currently online. For example, a single chip quad-core processor returns four. .IP "max_socket" 4 .IX Item "max_socket" Returns the number of populated \s-1CPU\s0 sockets, if known, else the same number as max_physical. For example, a single chip quad-core processor returns one. .IP "max_clock" 4 .IX Item "max_clock" Return the maximum clock speed across all online processors. Not all OSes support this call. .IP "processors" 4 .IX Item "processors" Return an array of processor references. See the Unix::Processors::Info manual page. Not all OSes support this call. .SH "DISTRIBUTION" .IX Header "DISTRIBUTION" The latest version is available from \s-1CPAN\s0 and from . .PP Copyright 1999\-2017 by Wilson Snyder. This package is free software; you you can redistribute it and/or modify it under the terms of either the \s-1GNU\s0 Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. .SH "AUTHORS" .IX Header "AUTHORS" Wilson Snyder .SH "SEE ALSO" .IX Header "SEE ALSO" Unix::Processors::Info, Sys::Sysconf