NT Internals Tips and Trivia Copyright © 1997 Mark Russinovich last updated March 15, 1997 Miscellaneous NT Information Introduction This page is an ever-expanding collection of NT information that we accumulate over time. You'll find practical tips as well useless trivia, with new items added at the top of the page. Never-ending In NT, as with most time-sharing operating systems, threads run in Quantum? turns called quantums. Normally, a thread executes until its quantum runs out. The next time it is scheduled it starts with a full quantum. However, in NT a thread also gets its quantum refreshed every time its thread or process priority is set. This means that a thread can reset its quantum by calling SetThreadPriority (without changing its priority) before its turn runs out. If it continues to do this it will effectively have an infinite quantum. Why does NT do this? Its not clear, but it appears to be a bug. NTOSKRNL's NTOSKRNL.EXE, the core file of the kernel-mode component of Windows Main NT, contains the Cache Manager, the Executive, the Kernel, the Security Reference Monitor, the Memory Manager, and the Scheduler, among other things, and is in charge of getting NT up and running. You may be surprised to know that it has a standard main() that is executed when it is loaded by the OSLOADER: // // NTOSKRNL main // int main() { // // Fire up NT! // KiSystemStartup(); return 0; } Fault One of the differences I highlighted in my November 1996 Windows NT Tolerance on Magazine article, "Inside the Difference Between Windows NT Workstation? Workstation and Windows NT Server," was that fault tolerant disk configurations are only available on Server. This is because the Windows NT disk administrative program, Windisk.exe, checks to see if its running on a Workstation, and if so, does not display its Fault Tolerance menu, which contains the entries that are used to create mirrors and parity striped sets. It turns out that whoever wrote the Workstation Resource Kit program FTEDIT was unaware of Microsoft's official policy on fault tolerance and Workstation: it appears you can use this utility to create mirrors and striped sets with parity on Workstations. Tuning NT Workstation and NT Server have vastly different performance Workstation characteristics due to the internal tuning that the NT operating for system, which is identical on both, performs. Most tuning Server-like parameters are inaccessible, but a few are located in the Registry. Loads If you are running Server and you double-click on the Server entry of the Services tab in the Control Panel's Network applet, you will get a dialog that lets you determine what type of application you want the machine to be tuned for. Choices let you select between "Minimize Memory Used", "Balance", "Maximize Usage for File Sharing", and "Maximize Usage for Network Applications". This dialog box is not presented on Workstation installations. The various selections actually change the values of two Registry values: HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache and HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\Size This table (which was derived from sessions with NTRegmon) presents the settings you should select on a Workstation to achieve the same effect you would get using the dialog box were your system a Server. Tuning Target LargeSystemCache Size Minimize Memory Used 0 1 Balance 0 2 File Sharing 1 3 Network Applications 0 3 ---------------------------------------------------------------------------- [Image]