apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Trawick" <traw...@gmail.com>
Subject Re: fcntl based mutex on Solaris/EM64T
Date Mon, 20 Aug 2007 15:23:34 GMT
On 8/19/07, Eric Covener <covener@gmail.com> wrote:
> A thread in proc1 will get EDEADLK from fcntl() on the LDAP mutex
>
>      A potential for deadlock occurs if a process  controlling  a
>      locked  region is put to sleep by attempting to lock another
>      process' locked region. If the system detects that  sleeping
>      until  a  locked  region is unlocked would cause a deadlock,
>      fcntl() will fail with an EDEADLK error.

sounds like process-wide locks such as fcntl() aren't intended for
this type of use

somewhat-simple testcase attached

./a.out lock1 15 lock2 &
./a.out lock2 3 lock1

first process spits out "lock2: Deadlock situation detected/avoided"

haven't tried on any platforms besides Solaris 10

Mime
View raw message