IPC::MMA

Shared Memory using Ralf Engelschall's mm library
Download

IPC::MMA Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Craig MacKenna
  • Publisher web site:
  • http://search.cpan.org/~mackenna/

IPC::MMA Tags


IPC::MMA Description

Shared Memory using Ralf Engelschall's mm library IPC::MMA is a Perl module that allows data to be shared among related Unix/Linux processes in a straightforward way. It provides methods to create and destroy shared memory segments and to create, access, and maintain data structures within segments. Perl scalars, arrays, and hashes can be stored in shared memory. This version of IPC::MMA will not store references.IPC::MMA is a superset of Arthur Choung's IPC::MM module, adding arrays and allowing any Perl scalar to be used as a hash/BTree key rather than just C strings. IPC::MMA hashes are like IPC::MM BTrees in that they return keys in sorted order in each, keys, and next operations.An IPC::MMA array can store data in any of six ways, including general-purpose scalars, signed or unsigned integers, floating-point numbers / large integers, fixed-length strings/records, and booleans at one bit per array element.SYNOPSIS use IPC::MMA; $mm = mm_create(memory_size, path_to_lockfile); $scalar = mm_make_scalar($mm); $array = mm_make_array($mm, type ]); $hash = mm_make_hash($mm ); tie $tiedScalar, 'IPC::MMA::Scalar', $scalar; tie @tiedArray, 'IPC::MMA::Array', $array; tie %tiedHash, 'IPC::MMA::Hash', $hash; mm_lock($mm, MM_LOCK_RD); mm_lock($mm, MM_LOCK_RW); mm_unlock($mm); DIRECT CALLS TIED EQUIVALENTS $ok = mm_scalar_store($scalar, $value); $tiedScalar = $value; $value = mm_scalar_fetch($scalar); $value = $tiedScalar; mm_free_scalar($scalar) $ok = mm_array_store($array, $index, $value); $tiedArray = $value; $value = mm_array_fetch($array, $index); $value = $tiedArray; $entries = mm_array_push($array, list); $entries = push @tiedArray, list; $value = mm_array_pop($array); $value = pop @tiedArray; $value = mm_array_shift($array); $value = shift @tiedArray; $entries = mm_array_unshift($array, list); $entries = unshift @tiedArray, list; if (mm_array_exists($array, $index)) {...} if (exists $tiedArray) { ... } $value = mm_array_delete($array, $index); $value = delete $tiedArray; @dels=mm_array_splice($array,$ix,$delCt,list); @dels=splice @tiedArray,$ix,$delCt,list; mm_array_clear($array ); $tiedArray = (); $entries = mm_array_fetchsize($array) $entries = scalar(@tiedArray) ($entries,$shiftCt,$type,$opt) = mm_array_status($array); mm_free_array($array) $ok = mm_hash_store($hash, $key, $value); $tiedHash{$key} = $value; $value = mm_hash_fetch($hash, $key); $value = $tiedHash{$key}; $value = mm_hash_delete($hash, $key); $value = delete $tiedHash{$key}; if(mm_hash_exists($hash, $key)) {...} if (exists $tiedHash{$key}) {...} while(($key,$val)=mm_hash_entry($hash,$ix++)) while(($key,$val)=each %tiedHash) {...} {...} @keys = keys %tiedHash; @values = values %tiedHash; $entries = mm_hash_scalar($hash); $entries = scalar %tiedHash; mm_hash_clear($hash ); @tiedHash = (); $key = mm_hash_first_key($array); $key = mm_hash_next_key($array, $key); mm_free_hash($hash); Requirements: · Perl


IPC::MMA Related Software