httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <jwool...@virginia.edu>
Subject Re: Caching a value for the lifetime of a module: CLUELESS
Date Tue, 08 Mar 2005 15:11:57 GMT
On Tue, 8 Mar 2005, luca regini wrote:

> My understanding about per server conf is that any structure allocated
> in the server config handler should have a lifetime that is the same as
> the one of the module. So the server config structure should be an ideal
> place for caching values.

But actually, it's not an ideal place at all, for the very reason you're
finding here.  I suspect what's happening to your code is that you're
running up against the fact that each child process has its own copy of
the server_rec and all of the server_config structures.  They are not in
shared memory, they're just duplicated when the parent forks itself.
Therefore these structures are really only meant to be written to by the
parent at config time.  Writing to them after that point will result in
inconsistent state across children.

--Cliff

Mime
View raw message