Win32 Subsystem Support
The Win32 subsystem (also known as the Client/Server subsystem) supports all 32-bit Windows applications and the rest of the environment subsystems.
Some of the primary features of Win-32 bit applications include the following:
- Reliability due to each application having its own 2 GB address space
- Support of multithreaded applications
- Take advantage of multiprocessor systems
- Take advantage of preemptive multitasking
Each Windows 32-bit application runs in its own 2 GB address space (see Figure 5.2). This design prevents one 32-bit application from overwriting the memory space of another 32-bit application. In other words, a failure of one 32-bit application does not affect other running 32-bit applications.
The major advantage of 32-bit applications over 16-bit applications is that they can be multithreaded. Each Windows NT process requires at least one thread. These threads enable execution to be scheduled. 32-bit applications can have more than one thread of execution.
The most common example of a multithreaded application is a 32-bit setup program. A 32-bit setup program generally has the following three threads of execution:
- A decompression thread that decompresses all files from a centralized archive file
- A copying thread that copies the decompressed files to the appropriate installation directory
- A system configuration thread that modifies all necessary configuration files to enable the application to execute correctly
The threads of execution, while independent of each other, must be timed correctly by the developer of the application. The copying thread must wait for the decompression thread to have expanded the necessary file before placing it in the proper directory. Likewise, the system configuration thread must ensure that a file has been copied to the proper directory if it needs to execute the program to enable configuration to take place. Figure 5.3 shows a typical setup progress meter for a 32-bit setup program. Note that there are separate setup bars for progress of expansion, copying, and configuration.
![[note.gif]](note.gif)
Multiple threads in a process share the same memory space. It is imperative that they do not overwrite other threads’ address space.
Having multiple threads also enables 32-bit applications to take full advantage of Windows NT’s capability to support Symmetric Multi-Processing (SMP). SMP enables each thread of an application to execute on the first available processor. Figure 5.4 shows how the capability of using Symmetric Multi-Processing can lead to improvements on execution time by splitting threads between processors. Both threads 1 and 2 display an improvement in execution time due to less time spent in wait states waiting for the other thread to relinquish control of the processor. Windows NT 32-bit multithreaded applications can take full advantage of a multi-processor system.
![[tip.gif]](tip.gif)
One of the most common exam questions relates to multi-processing. Remember that Windows NT supports Symmetric Multi-Processing (SMP). This enables Windows NT to use whichever processor is available instead of scheduling the O/S to use one processor and applications to use the other processor(s). Under Asymmetric Multi-Processing (ASMP), operating systems set aside one or more processors for the exclusive use of the operating system. Windows NT uses SMP because it provides better load balancing between processors. It also provides a degree of fault tolerance. This is because a processor failure in a multi-processor system results only in a degradation of performance. In an ASMP system, this can lead to the entire operating system crashing.
Finally, 32-bit applications can take part in preemptive multitasking. Rather than having the operating system wait for a thread to voluntarily relinquish control of the processor (as Windows 16 applications did), the operating system can interrupt a thread when one of the following events occurs:
- A thread has run for a specified length of time.
- A thread with a higher priority has become ready to execute.
The scheduling of threads by the operating system makes it more unlikely that an application will monopolize the processor.
Further Information