From: Olaf Kirch <okir@suse.de>
To: "Ara.T.Howard" <Ara.T.Howard@noaa.gov>
Cc: nfs@lists.sourceforge.net
Subject: Re: file system read locks
Date: Fri, 20 Aug 2004 17:39:21 +0200 [thread overview]
Message-ID: <20040820153921.GB6861@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.60.0408200907020.6148@harp.ngdc.noaa.gov>
On Fri, Aug 20, 2004 at 09:08:15AM -0600, Ara.T.Howard wrote:
> i have a perfectly functioning filesystem based write lock algorithim
> (link(2)).
Except that these FS based approaches don't support blocking; you
always have to poll.
> has anyone out there come up with an algorithim to make __read__
> locks using file system primitives?
Take a directory X. If the directory exists and is empty, the lock is not
taken by anyone. To take a read lock, create a file in that directory.
To take a write lock, remove the directory.
(This scheme has the drawback that it's highly unfair to writers, but you
can probably make it favor writers if you start to move it around rather
than rmdir it)
Olaf
--
Olaf Kirch | The Hardware Gods hate me.
okir@suse.de |
---------------+
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2004-08-20 15:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-20 15:08 file system read locks Ara.T.Howard
2004-08-20 15:39 ` Olaf Kirch [this message]
2004-08-20 16:15 ` Ara.T.Howard
2004-08-20 19:09 ` Ara.T.Howard
2004-08-21 21:04 ` strange behavior with gigE switch and 2.4.22 kernel Goutham Kurra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040820153921.GB6861@suse.de \
--to=okir@suse.de \
--cc=Ara.T.Howard@noaa.gov \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.