tailieunhanh - Windows Internals Covering Windows Server 2008 and Windows Vista phần 8

Cửa sổ các căn cứ câu hỏi "Ai nhận được CPU?" Trên chủ đề ưu tiên, nhưng làm thế nào để tiếp cận công việc trong thực tế? Các phần sau đây minh họa như thế nào ưu tiên theo định hướng hoạt động đa nhiệm ưu tiên về mức độ thread. | Chapter 5 Processes Threads and Jobs 413 0x020 LdtDescriptor _KGDTENTRY 0x028 Int21Descriptor _KIDTENTRY 0x030 IopmOffset 0x20ac 0x032 Iopl 0 0x033 Unused 0 0x034 ActiveProcessors 1 0x038 KernelTime 0 0x03c UserTime 0 0x040 ReadyListHead _LIST_ENTRY 0x85b32dd0 - 0x85b32dd0 0x048 SwapListEntry _SINGLE_LIST_ENTRY 0x04c VdmTrapcHandler null 0x050 ThreadListHead _LIST_ENTRY 0x861e7e0c - 0x860c14f4 0x058 ProcessLock 0 0x05c Affinity 3 0x060 AutoAlignment 0y0 0x060 DisableBoost 0y0 0x060 DisableQuantum 0y0 0x060 ReservedFlags 0y00000000000000000000000000000 0 0x060 ProcessFlags 0 0x064 BasePriority 8 0x065 QuantumReset 36 Scheduling Scenarios Windows bases the question of Who gets the CPU on thread priority but how does this approach work in practice The following sections illustrate just how priority-driven preemptive multitasking works on the thread level. Voluntary Switch First a thread might voluntarily relinquish use of the processor by entering a wait state on some object such as an event a mutex a semaphore an I O completion port a process a thread a window message and so on by calling one of the Windows wait functions such as WaitForSingleObject or WaitForMultipleObjects . Waiting for objects is described in more detail in Chapter 3. Figure 5-18 illustrates a thread entering a wait state and Windows selecting a new thread to run. In Figure 5-18 the top block thread is voluntarily relinquishing the processor so that the next thread in the ready queue can run as represented by the halo it has when in the Running column . Although it might appear from this figure that the relinquishing thread s priority is being reduced it s not it s just being moved to the wait queue of the objects the thread is waiting for. 414 Windows Internals Fifth Edition FIGURE 5-18 Voluntary switching Preemption In this scheduling scenario a lower-priority thread is preempted when a higher-priority thread becomes ready to run. This situation might occur for a couple of reasons A .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.