apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rohan Nandode <rnand...@yahoo.com>
Subject Problem with apr_proc_mutex
Date Tue, 25 Mar 2003 12:33:47 GMT

  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
  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.

What I am wondering is, eventhough in #1 a process has
acquired a lock, second process (in #2) can again
acquire a lock for same file name. Effectively
violating the locking.

After debugging, what I found is:
Both the processes create a separate semaphore and
hence both can acquire lock on same file.

What would be the cause of this? or Am I using valid
APR APIs to create inter process locking?
If not, then please let me know how to do it.

Thanks a lot

Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

View raw message