On 8/19/07, Eric Covener <[EMAIL PROTECTED]> 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

Attachment: testfcntl.c
Description: Binary data

Reply via email to