lkml.org 
[lkml]   [1999]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectfile locking issue
With both flock and fcntl-file locking (I have only tried with fctnl on
a whole file) this problem occurs:

If the process A gets a shared lock on the file and some process B after
that tries to get an exclusive lock on the file, process B will block.
(So far, so good).

If a third process C tries to get a shared lock on the file (where A
holds a lock and B tries to get one), it will get it.

So process B has to wait for C too.

And if a process D comes in and tries to get a shared lock that is
granted too, B has to wait.

Why is it like that? Cant incoming shared lock tries be queued to honor
B so it doesnt have to wait forever?

What does Posix say? Where can I get that documents?

Best regards
Anders Linden, Sweden


-
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:50    [W:0.034 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site