apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Martin <phi...@codematters.co.uk>
Subject Re: [PATCH] Re: apr_proc_mutex is broken
Date Tue, 19 Nov 2002 20:02:53 GMT
<rbb@rkbloom.net> writes:

> If you don't want the child process to destroy the mutex, then you should
> kill that cleanup in the child process.  That is why we have the
> apr_pool_cleanup_kill API.

Are you suggesting the application should do this, or the library?

Having the library do it doesn't sound very robust, when would you do
it?  At apr_proc_fork time?  What about a third party library that
doesn't use APR, calls fork directly and later runs atexit handlers?

The application cannot do it at present because it has no access to
the cleanup handler.  So this would mean adding a function to the
proc_mutex interface, apr_proc_mutex_cleanup_kill perhaps?  We would
need apr_global_mutex_cleanup_kill as well.  Even then, an application
using a proc_mutex has to know about every use of fork/apr_proc_fork
in every library.

I think the current pool cleanup handler is a mistake.  The handler
should cleanup only those resources local to the process, leaving the
proc_mutex in a working state.  It should be the application's
responsibility to call (or fail to call :) apr_proc_mutex_destroy at
the appropriate place.

-- 
Philip Martin

Mime
View raw message