A few words about thread switching and asynchronous calling -- from "Windows Kernel Scenario Analysis"

Source: Internet
Author: User
Tags apc

1. Thread Scheduling and thread Switching

Thread Scheduling occurs within the core layer, while thread switching occurs when the CPU releases the core layer.

2. APC (asynchronous process call) execution time

(1) For user APC, it is called when the target thread returns the user space from the kernel;

(2) For the kernel APC, it occurs when the CPU is reduced or the thread is switched;

3. DPC (delayed process call) Call time

When the CPU running level is reduced from dispatch-level or above to dispatch_level, the kernel scans the DPC queue and runs it. For example, when the service is terminated or kelovererql () is called.

4. About asynchronous Io

the current thread may wait for sleep from iostartpacket () to ioperformsyncronousrequest, or always return to the user space. The operation on the device is handed over to the interrupt service Program and the DPC function may have kernel threads. The work actually completed by the DPC function or kernel thread also includes the event V Operation for synchronization and submits the APC request.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.