You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Hongli Lai <ho...@gmail.com> on 2008/05/11 19:21:00 UTC

Do the worker and prefork MPMs forcefully kill child processes?

Hi, this is a question about Apache module development. I'm not sure 
whether I'm writing to the right mailing list, but this topic doesn't 
seem belong to the user mailing list. Please forgive me if I should have 
sent this email to a different mailing list.

I'm planning on using shared memory in my Apache module. This shared 
memory contains data structures, and will be read from and written to by 
all the Apache processes and threads. Needless to say, the data 
structures must be kept in a consistent state.

So I'm wondering whether the prefork and worker MPM will ever forcefully 
child processes. If that happens then I won't be able to keep my data 
structures in a consistent state.

Regards,
Hongli Lai

Re: Do the worker and prefork MPMs forcefully kill child processes?

Posted by Jille Timmermans <ji...@quis.cx>.
Hello,

Afaik it will happen:
First it will try to kill you 'softly', and it'll get more agressive 
after that.

So, I think if you exit fast enough after getting a signal, there will 
be no problem. (This will be more than at least one second).
So if you start hurrying and get your data written, there will no problem.
(I advise you to die yourself, that will safe the mpm from spending 
'much' time on you, and you won't get surprised by some SIGKILL on a 
'random' moment after it.)

Note: Core-dumping-signals will (sometimes ?) be passed right to all 
childs, when the master got hit by it

Please correct me if i'm wrong.

-- Jille

Hongli Lai schreef:
> Hi, this is a question about Apache module development. I'm not sure 
> whether I'm writing to the right mailing list, but this topic doesn't 
> seem belong to the user mailing list. Please forgive me if I should have 
> sent this email to a different mailing list.
> 
> I'm planning on using shared memory in my Apache module. This shared 
> memory contains data structures, and will be read from and written to by 
> all the Apache processes and threads. Needless to say, the data 
> structures must be kept in a consistent state.
> 
> So I'm wondering whether the prefork and worker MPM will ever forcefully 
> child processes. If that happens then I won't be able to keep my data 
> structures in a consistent state.
> 
> Regards,
> Hongli Lai