[003 Interrupt] The difference between tasklet and workqueue and the difference between the underlying implementation

1. The difference between tasklet and workqueue and the difference between the underlying implementation

(1) Both softirq and tasklet are soft interrupts, tasklet is a special implementation of softirq; workqueue is an ordinary work queue. 

(2) tasklet and workqueue, both of which are an implementation method of interrupting the lower half. The difference is that tasklet belongs to interrupt context, there is no process switching, and it cannot sleep or block (see [003 Interrupt] for details); workqueue is based on thread encapsulation and belongs to process context, so it supports sleep and blocking.


2. When to apply for suspension?

When Linux loads the corresponding driver and initializes the hardware device for the first time, the kernel will request an interrupt for the device.


3. Reference content

The difference between SOFTIRQ, Tasklet and Workqueue _SOFTIRQ

Guess you like

Origin blog.csdn.net/qq_41709234/article/details/131207495