Re: [FIX] Make deadlock detection work for file locking

From: almesber@lrc.di.epfl.ch
Date: Thu Aug 24 2000 - 16:38:02 EST


BTW, this is a little off-topic, I kind of wonder what the right semantics
for deadlock detection are with threads. POSIX 1003.1 1996-07-12 says:

  "A potential for deadlock occurs if a process controlling a locked
   region is put to sleep by attempting to lock the locked region of
   another process. If the system detects that sleeping until a
   locked region is unlocked would cause a deadlock, the fcntl()
   function shall fail with an [EDEADLK] error."

Okay, that's a little vague already. Now let's make it more interesting
by adding threads:

Process Thread Action (executed in this order)
A 1 grab lock X
B 1 grab lock Y
A 2 try to get lock Y
B 2 try to get lock X

Solaris 2.5.1 thinks this is a deadlock. Linux 2.4.0-test1-ac16 thinks
it isn't. I haven't found any definition of what "putting a process to
sleep" means in POSIX.1.

Opinions ?

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger@ica.epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:14 EST