How to open a device for exclusive access?
Ben Scott
dragonhawk at gmail.com
Mon Jul 16 14:12:45 EDT 2007
On 7/16/07, John Abreau <jabr at blu.org> wrote:
>> I've often wondered why, after 30+ years of *nix, there's still no
>> good way to handle locking/contention in the filesystem.
>
>
> File locking is pretty basic stuff. Breaking with tradition on it would
> mean a program won't work on BSD, Solaris, or other Unices.
Bah. :) Same excuse was used against X DRI, decent drag-and-drop,
dynamic device nodes, enhanced filesystems, etc., etc. One of the big
ways Linux succeeds is by advancing the state-of-the-art in *nix while
everyone else is busy worshiping at the altar of backwards
compatibility. This has succeeded so well that almost every other x86
*nix OS has since implemented some kind of Linux compatibility plan.
Linux did so well at ignored the standard that it has become the
standard for many. Change always brings some discomfort, but the
alternative is stagnation.
> You'd need a truly gigantic gain to offset that loss ...
Decent file locking would seem to be a rather nice gain in my book.
You're entitled to disagree. :)
> ... and you'd still be at risk if other programs that rely on traditional locking try
> to access the resources you've locked in a Linux-only manner.
One of the nice things about having decent file locking in the OS is
that programming mistakes don't lead to locking failures and obscure
data corruption down the road, they lead to straight-forward error
messages when the file is accessed.
Kinda like memory protection. We don't just assume everything will
behave itself; we use the memory manager to keep programs from
stepping on each other (even accidentally). IMO, it seems reasonable
to expect the same of file locking.
-- Ben
More information about the gnhlug-discuss
mailing list