The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Apache::Session::Lock::Ipc - Provides mutual exclusion using IPC

SYNOPSIS

 use Apache::Session::Lock::Ipc;
 
 my $locker = new Apache::Session::Lock::Ipc;
 
 $locker->acquire_read_lock($ref);
 $locker->acquire_write_lock($ref);
 $locker->release_read_lock($ref);
 $locker->release_write_lock($ref);
 $locker->release_all_locks($ref);

DESCRIPTION

Apache::Session::Lock::Ipc fulfills the locking interface of Apache::Session. Mutual exclusion is achieved through the use of shlock and shunlock functions of IPC::Shareable. Since this module does not support the notions of read and write locks, this module only supports write exclusive locks. When you request a shared read lock, nothing happens.

CONFIGURATION

This module must know the name of the "glue" (the id of the shared segment). By default, "SESS" is used.

Be carefull to the name used because it has to be composed by four characters. Example:

 tie %hash, 'Apache::Session::Ipc', $id, {
     IpcName => 'SESS',
 };

You can also add other IPC::Shareable options using the "IpcOptions" option. Example:

 tie %s, 'Apache::Session::Ipc', undef,
    {IpcName    => 'SESS',
     IpcOptions => {mode => 0600}
     };

AUTHOR

This module was written by Xavier Guimard <x.guimard@free.fr>

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Xavier Guimard

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.

SEE ALSO

Apache::Session, IPC::Shareable