Softirqs , tasklets, reentrant.

本文对比了软中断(softirqs)与任务调度(tasklets)在内核编程中的使用方式及特性。软中断静态分配,运行时并发执行,需自旋锁保护;任务调度则动态分配,由内核严格控制执行,同一类型的任务调度不会并发执行,简化了设备驱动开发者的工作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Softirqs are statically allocated (i.e., defined at compile time), while tasklets can also be
allocated and initialized at runtime (for instance, when loading a kernel module). Softirqs can
run concurrently on several CPUs, even if they are of the same type. Thus, softirqs are reentrant
functions and must explicitly protect their data structures with spin locks. Tasklets do not have
to worry about this, because their execution is controlled more strictly by the kernel. Tasklets
of the same type are always serialized: in other words, the same type of tasklet cannot be executed
by two CPUs at the same time. However, tasklets of different types can be executed concurrently on
several CPUs. Serializing the tasklet simplifies the life of device driver developers, because the
tasklet function needs not be reentrant.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值