Free mag vol1 | Page 688

CHAPTER 17  PROCESSES, APPDOMAINS, AND OBJECT CONTEXTS -> -> -> -> -> -> -> -> -> -> -> -> Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread ID: ID: ID: ID: ID: ID: ID: ID: ID: ID: ID: ID: 880 3380 3376 3448 3476 2264 2380 2384 2308 3096 3600 1412 Start Start Start Start Start Start Start Start Start Start Start Start Time: Time: Time: Time: Time: Time: Time: Time: Time: Time: Time: Time: 9:05 AM 9:05 AM 9:05 AM 9:05 AM 9:05 AM 9:05 AM 9:05 AM 9:05 AM 9:05 AM 9:07 AM 9:45 AM 10:02 AM Priority: Priority: Priority: Priority: Priority: Priority: Priority: Priority: Priority: Priority: Priority: Priority: Normal Normal Normal Normal Normal Normal Normal Normal Normal Highest Normal Normal The ProcessThread type has additional members of interest beyond Id, StartTime, and PriorityLevel. Table 17-4 documents some members of interest. Table 17-4. Select Members of the ProcessThread Type Member Meaning in Life CurrentPriority Gets the current priority of the thread Id Gets the unique identifier of the thread IdealProcessor Sets the preferred processor for this thread to run on PriorityLevel Gets or sets the priority level of the thread ProcessorAffinity Sets the processors on which the associated thread can run StartAddress Gets the memory address of the function that the operating system called that started this thread StartTime Gets the time that the operating system started the thread ThreadState Gets the current state of this thread TotalProcessorTime Gets the total amount of time that this thread has spent using the processor WaitReason Gets the reason that the thread is waiting Before you read any further, be very aware that the ProcessThread type is not the entity used to create, suspend, or kill threads under the .NET platform. Rather, ProcessThread is a vehicle used to obtain diagnostic information for the active Windows threads within a running process. Again, you will investigate how to build multithreaded applications using the System.Threading namespace in Chapter 19. 631