Daniel,

Unfortunately, *real* perl thread shared data isn't shared globally
(among all processes) in a forking environment like that of mod_perl in
Apache.  The single-process nature of native ithreads makes perl shared
variables reasonably impractical to use in a mod_perl environment.

Given the described design issue, only an IPC model would work, such as
SysV shared memory, BerkeleyDB, or an in-memory TCP cache like
memcached.  forks::BerkeleyDB is an attempt to abstract IPC into an
ithreads enviroment, allowing a preforking mod_perl environment behave
as a single thread group using BerkeleyDB as the underlying IPC model.

-Eric

--- Daniel Rychlik <[EMAIL PROTECTED]> wrote:

> solution The best would be *real* 
> threads with really shared variables, but this is another topic ;-)
> 
> No kidding...
> --------------------------
> Respectfully,
> Dan Rychlik
> IT Projects Engineer
> 
> 
> 
> -----Original Message-----
> From: Alvar Freude <[EMAIL PROTECTED]>
> To: Eric Rybski <[EMAIL PROTECTED]>; perl-ithreads@perl.org
> <perl-ithreads@perl.org>
> Sent: Wed Jul 04 12:11:56 2007
> Subject: Re: forks: shared variables between different applications
> or hosts
> 
> 
> Hi,
> 
> -- Eric Rybski <[EMAIL PROTECTED]> wrote:
> 
> > If you are using mod_perl 1.0, or mod_perl 2.0 with the 'prefork'
> MPM,
> > I have successfully worked with a few companies to integrate forks
> into
> > Apache httpd instances.  Additionally, if you use the
> forks::BerkeleyDB
> > add-on, you'll get excellent shared variable access performance
> (which
> > sounds like a requirement for your 100MB of data).
> 
> hmmm, for a typical page I need between 50 and 1000 hash lookups. And
> 
> sometimes more and sometimes fewer. But I'll make some tests: if this
> is 
> fast enough, it seems to be a very good solution The best would be
> *real* 
> threads with really shared variables, but this is another topic ;-)
> 
> 
> > I haven't yet posted Apache::forks to CPAN, but if you're
> interested in
> > evaluating it, I'll be happy to e-mail you a stable pre-release
> that
> > works with forks 0.23 and forks::BerkeleyDB 0.05.
> 
> OK -- first I'll do some benchmarks to test if it might work.
> I think it would be the easyest and best way to do it, if fast
> enough!
> 
> 
> Thanks && Ciao
>   Alvar
> 
> 
> -- 
> ** Alvar C.H. Freude, http://alvar.a-blast.org/
> **�http://www.assoziations-blaster.de/
> ** http://www.wen-waehlen.de/
> ** http://odem.org/
> 

Reply via email to