Three preemptive waits track Windows DLL handling, and this page covers them together: PREEMPTIVE_OS_LOADLIBRARY, the Windows LoadLibrary function; PREEMPTIVE_OS_FREELIBRARY, FreeLibrary; and PREEMPTIVE_OS_LIBRARYOPS, the generic wait for other DLL functions. Microsoft lists them as internal use only, so the names are the guide: each is the Windows function, or group of functions, SQL Server was calling. While a call runs, the thread is in preemptive mode, outside SQL Server’s scheduler.
Two examples for LIBRARYOPS are initialising the full-text subsystem and preparing an XML document. Extended stored procedure DLLs loading on first call are the other familiar case, with PREEMPTIVE_OS_GETPROCADDRESS finding the procedure inside the DLL.
Are They a Problem?
Rarely. They are not known contention points; our SQL Server 2025 lab had 3 loads in a day totalling 0.14 seconds. Get Wait Statistics does not filter them out. Slow loads have ordinary causes: a DLL on a network path, antivirus scanning binaries as they load, or signature checks stalling, which the crypto waits cover.
When They Do Matter
When loads are frequent or slow. Frequent loads mean something keeps loading and unloading a DLL; slow ones point at the file path or a filter driver. Any foreign DLL in the SQL Server process is also worth accounting for from a security point of view; the extended procedure list on MSQL_XP shows the registered ones. The baseline to monitor is loads staying rare once the instance is up.
The PREEMPTIVE_OS Call Waits
Each of these is SQL Server calling a Windows function outside the file and security groups: networking, pipes, the registry, the event log, DLLs and the cluster. The time is spent in Windows. If one is near the top of your waits, read it next to the waits that usually matter.
- Network waitsDNS and sockets. GETADDRINFO name lookups and Winsock calls; slow DNS shows here.Worth a look when it climbs
- PREEMPTIVE_OS_PIPEOPSPipes. Windows pipe functions, such as xp_cmdshell reading its command output.Worth a look when it climbs
- PREEMPTIVE_OS_WAITFORSINGLEOBJECTClient sync. Synchronising with an external client process; often seen with ASYNC_NETWORK_IO.Worth a look when it climbs
- PREEMPTIVE_OS_QUERYREGISTRYRegistry. Windows registry functions.Worth a look when it climbs
- PREEMPTIVE_OS_REPORTEVENTEvent log. The Windows ReportEvent function, writing to the event log.Worth a look when it climbs
- PREEMPTIVE_OS_GETPROCADDRESSXP entry points. Finding an extended stored procedure’s address in its DLL.Worth a look when it climbs
- Library waitsDLL loading. Loading and unloading DLLs in the SQL Server process.Usually noise. This page.
- Cluster waitsFailover cluster. Windows failover cluster API calls.Usually noise
- Miscellaneous waitsEverything else. The remaining single-call waits, such as VSS, FILESTREAM device and service calls.Worth a look when it climbs
Where To Go Next
These DLL waits are usually tiny. If you are chasing a real problem, start with the waits that cost you time.
- MSQL_XP, extended stored procedures, the usual DLL callers.
- The waits that usually matter, ranked, with what each one is telling you.
- Performance & Troubleshooting, the scripts and guides for this part of the stack.
Leave a Reply