lkml.org 
[lkml]   [2000]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [FIX] Make deadlock detection work for file locking
On Thu, Aug 24, 2000 at 11:38:02PM +0200, almesber@lrc.di.epfl.ch wrote:

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

I don't have POSIX in front of me, but I do not think
the system must detect deadlock. It is allowed to detect
deadlock, and in case it happens to do so EDEADLK is the
apprpriate error return.

Andries
-
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/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.513 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site