Tie::Win32MemMap - TieHash functionality for Win32-MemMap
Win32-MemMap http://wwws01.valero.com/perl/packages
Storable
use Tie::Win32MemMap;
tie(%h, 'Tie::Win32MemMap', { Create => MEM_NEW_SHARE, MapName => 'Test', Size => 100000 });
This TIEHASH package will tie a hash structure to a shared memory space on Windows NT. This allows Perl applications to communicate any kind of data between themselves using the fastest method possible.
MEM_NEW_SHARE
MEM_VIEW_SHARE
tie %h, 'Tie::Win32MemMap', { Create => 1|0 [,MapName => $name [,Size => $size]] }
Arguements are passed as an anonymous hash. The only required arguement is Create.
Create: If set to true, a new memory share is created in memory, otherwise an attempt to map a 'View' to an existing share (created by another process) is made. See CONSTANTS.
MapName: The name used to identify the memory share. If not provided, the name 'Default' is used.
Size: The size in bytes to be allocated for the memory share. If not provided, a default size of 100,000 bytes will be allocated. This arguement is ignored for 'Views'.
# Parent.pl
use Tie::Win32MemMap;
tie(%h, 'Tie::Win32MemMap', { Create => MEM_NEW_SHARE, MapName => 'Test', Size => 10000 });
$h{key} = [qw(apple bananna orange)];
$h{key2} = "this is my string\n";
while (1) { sleep 1 }
__END__
# Child.pl
use Tie::Win32MemMap;
tie(%h, 'Tie::Win32MemMap', { Create => MEM_VIEW_SHARE, MapName => 'Test' });
print $h{key}->[1], "\n";
print $h{key2}, "\n";
__END__
03/27/2000 - Version 1.02
Grant Hopwood
hopwoodg@valero.com
Hack n' slash babee.
Win32::MemMap is copyright Amine Moulay Ramdane (aminer@generation.net).