PC Ext: Explanation of Opportunistic Locking on Windows NTLast reviewed: May 20, 1996Article ID: Q150991 |
The information in this article applies to:
SUMMARYWith Exclusive Oplock, if a file is opened in a non-exclusive (deny none) mode, the redirector requests an opportunistic lock of the entire file. As long as no other process has the file open, the server will grant this oplock, giving the redirector exclusive access to the specified file. This will allow the redirector to perform read-ahead, write-behind, and lock caching, as long as no other process tries to open the file. When a second process tries to open the file, the original owner will be asked to "break oplock" or "break to level II oplock." At that point the redirector must invalidate cached data, flush writes and locks, and release the oplock or close the file. Opportunistic Locking level II provides a method for granting read access to a file by more than one workstation and these workstations can cache read data locally (read-ahead). As long as no station writes to the file, multiple stations can have the file open with level II oplock.
MORE INFORMATIONAn illustration of how level II oplocks work:
WARNING: Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows NT to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.
WORKSTATION SERVICE ENTRIESHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet \Services\LanmanWorkstation\Parameters UseOpportunisticLocking REG_DWORD 0 or 1Default: 1 (true) Indicates whether the redirector should use opportunistic-locking (oplock) performance enhancement. This parameter should be disabled only to isolate problems.
SERVER SERVICE ENTRIESHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet \Services\LanmanServer\Parameters EnableOplocks REG_DWORD 0 or 1Default: 1 (true) Specifies whether the server allows clients to use oplocks on files. Oplocks are a significant performance enhancement, but have the potential to cause lost cached data on some networks, particularly wide-area networks.
MinLinkThroughput REG_DWORD 0 to infinite bytes per secondDefault: 0 Specifies the minimum link throughput allowed by the server before it disables raw and opportunistic locks for this connection.
MaxLinkDelay REG_DWORD 0 to 100,000 secondsDefault: 60 Specifies the maximum time allowed for a link delay. If delays exceed this number, the server disables raw I/O and opportunistic locking for this connection.
OplockBreakWait REG_DWORD 10 to 180 secondsDefault: 35 Specifies the time that the server waits for a client to respond to an oplock break request. Smaller values can allow detection of crashed clients more quickly but can potentially cause loss of cached data.
|
KBCategory: kbenv
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |