Free mag vol1 | Page 681

CHAPTER 17  PROCESSES, APPDOMAINS, AND OBJECT CONTEXTS  Note By default, the PID column of the Processes tab will not be shown. To enable this feature, activate the View  Select Columns… menu option, and then check the PID (Process Identifier) checkbox. Figure 17-1. The Windows Task Manager The Role of Threads Every Windows process contains an initial “thread” that functions as the entry point for the application. Chapter 19 examines the details of building multithreaded applications under the .NET platform; however, to facilitate the topics presented here, you need a few working definitions. First of all, a thread is a path of execution within a process. Formally speaking, the first thread created by a process’s entry point is termed the primary thread. Any .NET executable program (Console Application, Windows Forms application, WPF application, etc.) marks its entry point with the Main() method. When this method is invoked, the primary thread is created automatically. Processes that contain a single primary thread of execution are intrinsically thread safe, given the fact that there is only one thread that can access the data in the application at a given time. However, a single-threaded process (especially one that is GUI-based) will often appear a bit unresponsive to the user if this single thread is performing a complex operation (such as printing out a lengthy text file, 624