Try Microsoft Edge, a fast and secure browser that's designed for Windows 10 Get started

Microsoft
  • Store
    Store home
    Devices
    • Microsoft Surface
    • PCs & tablets
    • Xbox
    • Virtual reality
    • Accessories
    • Windows phone
    Software & Apps
    • Office
    • Windows
    • Additional software
    • Windows apps
    • Windows phone apps
    Games & Entertainment
    • PC games (disc)
    • Windows digital games
    • Windows phone games
    • Movies & TV
    • Music
    Deals
    • Sale
    • Microsoft Surface deals
    • PC deals
    • Xbox deals
    More
    • Business
    • Students & educators
    • Developer
    • Gift cards
  • Products
    Software & services
    • Windows
    • Office
    • Free downloads & security
    • Internet Explorer
    • Microsoft Edge
    • Skype
    • OneNote
    • OneDrive
    • Microsoft Health
    • MSN
    • Bing
    • Microsoft Groove
    • Microsoft Movies & TV
    Devices & Xbox
    • All Microsoft devices
    • Microsoft Surface
    • All Windows PCs & tablets
    • PC accessories
    • Xbox & games
    • Microsoft Lumia
    • All Windows phones
    • Microsoft HoloLens
    For business
    • Cloud Platform
    • Microsoft Azure
    • Microsoft Dynamics 365
    • Windows for business
    • Office for business
    • Skype for business
    • Surface for business
    • Enterprise solutions
    • Small business solutions
    • Find a solutions provider
    • Volume licensing
    For developers & IT pros
    • Develop Windows apps
    • Microsoft Azure
    • MSDN
    • TechNet
    • Visual Studio
    For students & educators
    • Office for students
    • OneNote in classroom
    • Shop PCs & tablets perfect for students
    • Microsoft in Education
  • Support
Sign in
  • items in cart
items in cart

 Manage my account
 Manage my account
 Ask the community
 Contact us
 Find downloads

CV: z5CMp1DoTBAAO57k.0

PC Ext: Explanation of Opportunistic Locking on Windows NT

  •  Email
  •  Print

Summary

With 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 attempts 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 Information

An illustration of how level II oplocks work:

  1. Station 1 opens the file, requesting oplock.
  2. Since no other station has the file open, the server grants station 1 exclusive oplock.
  3. Station 2 opens the file, requesting oplock.
  4. Since station 1 has not yet written to the file, the server asks station 1 to Break to Level II Oplock.
  5. Station 1 complies by flushing locally buffered lock information to the server.
  6. Station 1 informs the server that it has Broken to Level II Oplock (alternatively, station 1 could have closed the file).
  7. The server responds to station 2's open request, granting it level II oplock. Other stations can likewise open the file and obtain level II oplock.
  8. Station 2 (or any station that has the file open) sends a write request SMB. The server returns the write response.
  9. The server asks all stations that have the file open to Break to None, meaning no station holds any oplock on the file. Because the workstations can have no cached writes or locks at this point, they need not respond to the break-to-none advisory; all they need do is invalidate locally cashed read-ahead data.
The following registry entries are used to enable or disable oplocks for Windows NT Workstation or Server. These registry keys may not exist by default. To access the registry run REGEDT32.EXE from the File menu, choose Run in Program Manager or File Manager.

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 Entries


\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
\Services\LanmanWorkstation\Parameters

UseOpportunisticLocking REG_DWORD 0 or 1
Default: 1 (true)
Indicates whether the redirector should use opportunistic-locking (oplock) performance enhancement. This parameter should be disabled only to isolate problems.

Server Service Entries


\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
\Services\LanmanServer\Parameters

EnableOplocks REG_DWORD 0 or 1
Default: 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 second
Default: 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 seconds
Default: 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 seconds
Default: 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.

Properties

Article ID: 129202 - Last Review: Dec 4, 2003 - Revision: 1

Feedback
Thanks! Your feedback will help us improve the support experience.

Support

Support

  • Account support
  • Supported products list
  • Microsoft Lifecycle Policy

Security

Security

  • Safety & Security Center
  • Download Security Essentials
  • Malicious Software Removal Tool

Contact Us

Contact Us

  • Report a support scam
  • Disability Answer Desk
  • Locate Microsoft addresses worldwide
This site in other countries/regions
Algérie - Français
Argentina - Español
Australia - English
Belgique - Français
België - Nederlands
Bolivia - Español
Bosna i Hercegovina - Hrvatski
Brasil - Português
Canada - English
Canada - Français
Chile - Español
Colombia - Español
Costa Rica - Español
Crna Gora - Srpski
Danmark - Dansk
Deutschland - Deutsch
Dominican Republic - Español
Ecuador - Español
Eesti - Eesti
El Salvador - Español
España - Español
Estados Unidos - Español
France - Français
Guatemala - Español
Hong Kong SAR - English
Hrvatska - Hrvatski
India - English
Indonesia (Bahasa) - Bahasa
Ireland - English
Italia - Italiano
Latvija - Latviešu
Lietuva - Lietuvių
Luxembourg - Français
Magyarország - Magyar
Malaysia - English
Maroc - Français
México - Español
Nederland - Nederlands
New Zealand - English
Norge - Bokmål
Panamá - Español
Paraguay - Español
Perú - Español
Philippines - English
Polska - Polski
Portugal - Português
Puerto Rico - Español
România - Română
Schweiz - Deutsch
Singapore - English
Slovenija - Slovenščina
Slovensko - Slovenčina
South Africa - English
Srbija - Srpski
Suisse - Français
Suomi - Suomi
Sverige - Svenska
Tunisie - Français
Türkiye - Türkçe
United Kingdom - English
United States - English
Uruguay - Español
Venezuela - Español
Việt Nam - Tiếng việt
Ísland - Íslenska
Österreich - Deutsch
Česká Republika - Čeština
Ελλάδα - Ελληνικά
България - Български
Казахстан - Русский
Россия - Русский
Україна - Українська
ישראל - עברית
الإمارات العربية المتحدة - العربية
المملكة العربية السعودية - العربية
مصر - العربية
भारत - हिंदी
ไทย - ไทย
中国 - 简体中文
台灣 - 繁體中文
日本 - 日本語
香港特別行政區 - 繁體中文
대한민국 - 한국어
Algérie - Français
Estados Unidos - Español
Perú - Español
Việt Nam - Tiếng việt
Argentina - Español
France - Français
Philippines - English
Ísland - Íslenska
Australia - English
Guatemala - Español
Polska - Polski
Österreich - Deutsch
Belgique - Français
Hong Kong SAR - English
Portugal - Português
Česká Republika - Čeština
België - Nederlands
Hrvatska - Hrvatski
Puerto Rico - Español
Ελλάδα - Ελληνικά
Bolivia - Español
India - English
România - Română
България - Български
Bosna i Hercegovina - Hrvatski
Indonesia (Bahasa) - Bahasa
Schweiz - Deutsch
Казахстан - Русский
Brasil - Português
Ireland - English
Singapore - English
Россия - Русский
Canada - English
Italia - Italiano
Slovenija - Slovenščina
Україна - Українська
Canada - Français
Latvija - Latviešu
Slovensko - Slovenčina
ישראל - עברית
Chile - Español
Lietuva - Lietuvių
South Africa - English
الإمارات العربية المتحدة - العربية
Colombia - Español
Luxembourg - Français
Srbija - Srpski
المملكة العربية السعودية - العربية
Costa Rica - Español
Magyarország - Magyar
Suisse - Français
مصر - العربية
Crna Gora - Srpski
Malaysia - English
Suomi - Suomi
भारत - हिंदी
Danmark - Dansk
Maroc - Français
Sverige - Svenska
ไทย - ไทย
Deutschland - Deutsch
México - Español
Tunisie - Français
中国 - 简体中文
Dominican Republic - Español
Nederland - Nederlands
Türkiye - Türkçe
台灣 - 繁體中文
Ecuador - Español
New Zealand - English
United Kingdom - English
日本 - 日本語
Eesti - Eesti
Norge - Bokmål
United States - English
香港特別行政區 - 繁體中文
El Salvador - Español
Panamá - Español
Uruguay - Español
대한민국 - 한국어
España - Español
Paraguay - Español
Venezuela - Español
  • English (United States)‎
  • Terms of use
  • Privacy & cookies
  • Trademarks
  • © 2017 Microsoft