Stas Bekman wrote:

Philippe M. Chiasson wrote:

Stas Bekman wrote:

Philippe M. Chiasson wrote:

I noticed browsing some code that there is a threaded_mpm field in mp's server config structure.

That is a global proprety and doesn't have to live in the server config, so this patches replaces
that code with the (already there, but not used) threaded_mpm global.

It doesn't make a significant speed/memory improvement, but it removes a bit of unnecessary
logic.




I wonder why do we need the modperl_global_ interface for that. Won't a static variable do the trick?



Well, correct me if I am wrong, but I just thought the modperl_global_ interface was there mainly to clearly
identify globals and centralize their managments. So that's why I thought it should be used.

I guess the more important question is : What is the modperl_global_ interface intended for ?


it's intended for manipulating globals while running workers, e.g.:

lock_mutex
set_global_foo
unlock_mutex

in another thread:

lock_mutex
get_global_foo
unlock_mutex

Yes, that's correct. (locking/unlocking isn't necessary since get_global_foo takes care of it)

in the case of threaded_mpm it's a set-once before threads/workers appear, and then it's always read-only, so there are no thread-safety issues, so i can't see what's the added value in using the modperl_global_ interface for this.

You are right on this point. I wrongly assumed we were using the modperl_global_ infrastructure for all globals.
I'll change my patch and resubmit.





Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to