lkml.org 
[lkml]   [1999]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectfile locking starvation?
[I posted about this a couple of weeks ago, when this list was being very
slow. I never saw it appear, so am assuming it got lost]

Consider this situation:

1. Process A locks a file, using fcntl(..., F_SETLKW, ... ).

2. Process B tries to lock the file the same way, and so goes to
sleep waiting for the lock.

3. Process A releases the lock, but then immediately tries to
reaquire it.

On Linux (2.2.9 is the only one I tested), process A gets the lock back in
step #3. Anyone else think that step #3 should put A to sleep and let B
get the lock? An application that wants that behavior can get it by throwing
in a sleep(0) between A's releasing the lock and attempting to reaquire it,
but is it supposed to have to do that?

--Tim Smith


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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