Subject: | |
From: | |
Reply To: | |
Date: | Tue, 2 Dec 1997 14:25:15 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Lars Appel writes:
>Can anybody enlighten me why LOCK and UNLOCK operations show different
>performance depending on the size of the file? I always believed that
>these two operate on some kind of semaphore attached to the file (gufd
>or whatever internal structure). Does UNLOCK trigger some kind of post?
Yes, FUNLOCK posts buffers to the file. That's necessary since every
user's view of the file has to be consistent after the UNLOCK, but not
necessarily while the file is locked. The need to post buffers means that
every page of the file that's in memory has to be checked to see if it's
dirty. If a lot of the file is in memory, that can take a while.
For large files, one alternative is to lock a separate, small file that
exists entirely for the purpose of providing a semaphore. That works very
well for memory-mapped files, but I'm not sure if FLOCK/FUNLOCK also
interact with transaction management in some way. If so, you'd lose the
benefit of that management if you use a separate semaphore file.
-- Bruce
--------------------------------------------------------------------------
Bruce Toback Tel: (602) 996-8601| My candle burns at both ends;
OPT, Inc. (800) 858-4507| It will not last the night;
11801 N. Tatum Blvd. Ste. 142 | But ah, my foes, and oh, my friends -
Phoenix AZ 85028 | It gives a lovely light.
btoback AT optc.com | -- Edna St. Vincent Millay
Unsolicited mail to [log in to unmask] will be inspected for a
fee of US$250. Mailing to said address constitutes agreement to
pay, including collection costs.
|
|
|