You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Jeffrey W. Baker" <jw...@acm.org> on 2004/03/07 20:39:22 UTC

Re: serializing access to a resource in my mod_perl PerlHandler

On Sat, 2004-03-06 at 08:33, John Kelly wrote:
> Hi,
> 
> this is an oldbie question - i used to know something about mod_perl
> but haven't used it for so
> so long I've forgotten it all :)
> 
> a mod_perl script i wrote quite some time ago has recently had
> increased "traffic". this has shown up a problem (i think) with
> serialization of resource in the "back-end" system that my mod_perl
> routine provides
> a wrapper for.
> In the short-term, while I'm investigating the problem I'd like
> quickly to modify something so all requests through the PerlHandler
> which processes the content are serialized.
> So, is there a configuration directive which can do this without
> modification to the script itself ? If not, how can i implement some
> form of serialization within the handler ?

If I may, I'll assume you are using a Unix.  I would just use
IPC::Semaphore.

At the risk of falling victim to hammer/nail syndrome, I could also
point out that you could create an object of type
Apache::Session::Lock::* and invoke the serialization methods thereof. 
See ::Sempahore, ::MySQL, etc.

Cheers,
jwb

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html