perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: Question : threads and locking?
Date Tue, 04 Dec 2001 13:10:27 GMT
Philippe M. Chiasson wrote:

> Looking thru the todo/api.txt file, I noticed a few items that
> are stuck in read-only mode, because thread locking is needed if
> changing them.
> I already have something in the works, but my question is that under
> a non-threaded model, like prefork, all that is uesless, right? So,
> what's the nice way for me to go on and write thread mutex stuff
> that will only happen when running under threads ? 
> My knoledge of the configure/build system is quite limited....

If you are running under threaded mpm, you can safely assume that Perl 
is threaded (won't pass the build otherwise). So no conditioning 
required fromt the Perl side.

Since the preforked mpm can actually be compiled with threaded apr, I think that's 

the only ifdef() required is:

     /* code here */

If the functionality is very different between forked and non-forked 
implementation, to avoid code cluttering with ifdefs, we probably should 
use two versions of the functions like foo_thr() and foo_nthr() and 
alias to foo() at compile time.

Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker      mod_perl Guide

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message