httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: Problem with apr_proc_mutex
Date Thu, 27 Mar 2003 17:17:54 GMT
At 02:03 AM 3/27/2003, Rohan Nandode wrote:
>Hi,
>
>  Apologies for posting it here, but haven't got any
>response in dev@apr.httpd.org.
>
>  I am using APR library on Linux system where it uses
>SystemV type locking mechanism. I am seeing a problem
>with inter process locking- apr_proc_mutex_XXX
>functions.
>  I want to create a inter process lock to serialize
>to process. What I have done is:
>1. Created a apr_proc_mutex_t with a valid lock file
>name in a process and aquired a write lock on it. Both
>the operations were successful.
>2. In second process, I created a apr_proc_mutex_t
>mutex with same filename as in above and acquired a
>lock. Again both are successful.
>3. Both the mutexes are created with DEFAULT mechanism
>and which is SystemV type.

Rohan, the implementation today is quite fork()-centric, meaning
the mutexes are generally used between sibing processes that inherit
the mutex.  Since you have two seperate processes, we need to look
at that;

1. our APR_LOCK_SYSVSEM isn't a name-based lock.

2. you probably want to be explicit, anyways, about your mutex method,
   e.g. try this list in order...

    APR_LOCK_FCNTL
    APR_LOCK_FLOCK

3. failing that, we have a bug in APR_LOCK_POSIX that the fname passed
   is ignored, so a random one is invented, but a patch at line 129 of
   proc_mutex.c could make that hassle disappear.

4. finally it seems like APR create_mutex should have a 'named lock' flag 
   that allows the user to insist on a named (cross-process) lock instead 
   of any anonymous lock.

The reason you had no response is you mailed the wrong list - please use
dev@apr.apache.org for this sort of discussion about the portability library!

Bill



Mime
View raw message