Solaris::Lgrp Perl module
This Perl module provides a Perl interface to the locality group (lgroup) APIs found in liblgrp(3LIB). Thus, this interface provides a way to traverse the lgroup hierarchy, discover its contents and characteristics, and set a thread's affinity for an lgroup.
The module gives access to various constants and functions defined in
<sys/lgrp_user.h> header file. It provides both the procedural and object
interface to the library. The procedural interface requires (in most cases)
passing a transparent cookie around. The object interface hides all the cookie
manipulations from the user.
Functions returning scalar value indicate error by returning undef. The
caller may examine the $! variable to get the errno value.
Functions returning list value return the number of elements in the list when
called in scalar context. In case of error the empty list is return in the array
context and undef is returned in the scalar context.
Simple example:
use Solaris::Lgrp qw(:ALL);
my $l = Solaris::Lgrp->new();
my $home = l->home(P_PID, $$);
- Solaris::Lgrp Documentation
- Full module, version 0.1.2
- Perl part of the module
- Perl XS glue code
- Makefile.PL
- lgrpinfo(1) - tool to display lgroup information and its source
- PSARC proposal draft
The module is also available on CPAN.
All the code above is provided under the rems of the OpenSolaris CDDL License.
Issues
- Remove duplication of man page descriptions for liblgrp APIs, refer to them instead, and highlight what's different about Perl interface instead
Comments
Please send your comments and suggestions to the discussion forum.