Re: How to persist and query a hash lookup in memory with Perl ?
- From: Ben Morrow <ben@xxxxxxxxxxxx>
- Date: Thu, 29 Nov 2007 23:35:35 +0000
Quoth Jack <jack_posemsky@xxxxxxxxx>:
<snip: some sort of persistant shared memory>
Thanks I am willing to install Perl Modules, really wondering if there
is a native ability to do it out of the box in Perl.
Well, on systems that support it you can use SysV shared memory, for
which Perl natively has the raw shm* calls. This doesn't work on
Windows, though.
You could try IPC::Shareable for Unix and Win32::MMF::Shareable (which
has the same interface) for Win32, which provide an easier interface to
shared memory.
Another alternative would be mmap, using the Sys::MMap module. mmap is
substantially better behaved than SysV shm, and portable to Windows.
I got persistent memory to work but its not clear how to "pin" a hash
lookup into memory since .pl files and the persistent memory code
example itself are only as good as the life of the execution of the
script !!
In what sense then is this memory 'persistent'? I think you are rather
confused about what is and isn't possible under modern operating
systems: unless you take steps to prevent it, all memory allocated by a
process is released when that process exits. This is a feature :).
Ben
.
- Follow-Ups:
- References:
- How to persist and query a hash lookup in memory with Perl ?
- From: Jack
- Re: How to persist and query a hash lookup in memory with Perl ?
- From: jackposemsky
- Re: How to persist and query a hash lookup in memory with Perl ?
- From: Jim Gibson
- Re: How to persist and query a hash lookup in memory with Perl ?
- From: Jack
- How to persist and query a hash lookup in memory with Perl ?
- Prev by Date: Sorted Hash
- Next by Date: Re: SvUOK always fails on 64bit platform
- Previous by thread: Re: How to persist and query a hash lookup in memory with Perl ?
- Next by thread: Re: How to persist and query a hash lookup in memory with Perl ?
- Index(es):
Relevant Pages
|