Leon Timmermans > POSIX-RT-SharedMem > POSIX::RT::SharedMem

Download:
POSIX-RT-SharedMem-0.10.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.10   Source  

NAME ^

POSIX::RT::SharedMem - Create/open or unlink POSIX shared memory objects in Perl

VERSION ^

version 0.10

SYNOPSIS ^

 use POSIX::RT::SharedMem qw/shared_open/;

 shared_open my $map, '/some_file', '+>', size => 1024, perms => oct(777);

DESCRIPTION ^

This module maps POSIX shared memory into a variable that can be read just like any other variable, and it can be written to using standard Perl techniques such as regexps and substr, as long as they don't change the length of the variable.

FUNCTIONS ^

shared_open $map, $name, $mode, ...

Map the shared memory object $name into $map. For portable use, a shared memory object should be identified by a name of the form '/somename'; that is, a string consisting of an initial slash, followed by one or more characters, none of which are slashes.

$mode determines the read/write mode. It works the same as in open and map_file.

Beyond that it can take three named arguments:

It returns a filehandle that can be used to with stat, chmod, chown. For portability you should not assume you can read or write directly from it.

shared_unlink $name

Remove the shared memory object $name from the namespace. Note that while the shared memory object can't be opened anymore after this, it doesn't remove the contents until all processes have closed it.

SEE ALSO ^

AUTHOR ^

Leon Timmermans <leont@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2010 by Leon Timmermans.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: