gk>> not terribly good portability, according to
gk>> /usr/src/linux/Documentatino/mandatory.txt , for mandatory locks?
gk>> advisory locks can be used, but then you only have a single such lock
gk>> available per file. if you need to use several locks, you need to keep

What? You sure should use advisory ones, for if you thought about
semaphores, you are surely writing cooperative application. But advisory
lock can be set one per each _byte_ of the file, not one per file. And
since you are not limited by the filesize, this gives you, IIRC, about 4G
of locks per file. Each lock, though, wastes certain amount of kernel
memory, so you should not use all of them ;)

gk>> several files open, and since there's a limit on file descriptors per
gk>> process, this is not scaleable.

Frankly, how many locks do you need? Thousands? Billions? Most probably
two or three, really.

gk>> well, i'm not sure that usage of locks performs any file I/O (after all,

No, it does not. As for speed - this is very OS-dependant. I remember
seeing some numbers in Stevens, but I don't remember what they told. IIRC,
for Linux it's pretty much the same.

gk>> and sometimes get traversed - thus, if you have many locks active on a
gk>> single file, that'll be less efficient then using semaphores.

Well, that's true - but really,, how many apps except databases (where
semaphores are irrelevant anyway, since you need to lock real files) have
more than ten locks?
-- 
[EMAIL PROTECTED]      \/  There shall be counsels taken
Stanislav Malyshev      /\  Stronger than Morgul-spells
phone +972-3-9316425    /\              JRRT LotR.
http://sharat.co.il/frodo/      whois:!SM8333


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to