tasklet and workqueue(from linux kernel development )
来源:互联网 发布:ubuntu 开启samba 编辑:程序博客网 时间:2024/05/16 12:03
difference between those two mechanism :
tasklet is delayed for short time ,and it cannot sleep !
workqueue can be delayed for long time ,and it can sleep in the interrupt time !
workqueue is treated as kernel thread !
tasklet is made on the top of softirq!
they all used in interrupt handler (bottom half )!
what is the softirq ?
it is a mechanism looksmart like software interrupt !
detail about workqueue:it deferred work into kernel thread! so code of this bottom half can run in the process context ! And workqueue has all the benefit of process !it is scheduled and can be sleep !
use workqueue is going to create a new kernel thread !
workqueue is usually an interface to create a kernel thread to handle workqueue elsewhere!
kernel thread is called worker thread !
the workqueue subsystem implement and provide a default worker thread for deferred work queue!
default worker thread (kernel thread )is named events/n,n is the processor number !
that is how much processor ,then how many work thread!we can create our own kernel thread if necessary !
default worker thread is preferred !but also our own worker thread get some benefit !
the worker thread is represented by the structure workerqueue _struct (like task_struct of process )
struct workqueue_struct {
struct cpu_workqueue_struct cpu_wq[NR_CPUS];/////////////////////////////////////////////////
struct list_head list;
const char *name;
int singlethread;
int freezeable;
int rt;
};
struct cpu_workqueue _struct is per -processor ! workqueue of each processor have one such structure !
struct cpu_workqueue_struct {
spinlock_t lock; /* lock protecting this structure */
struct list_head worklist; /* list of work */
wait_queue_head_t more_work;
struct work_struct *current_struct;
struct workqueue_struct *wq; /* associated workqueue_struct */
task_t *thread; /* associated thread *//////////////////////////////////////////////////////////////
};
each processor have one worker thread !
struct work_struct {
atomic_long_t data;
struct list_head entry;
work_func_t func;
};
function associated with worker thread
those structure is strung into a link list ! one node is each structure of worker thread of each processor
- tasklet and workqueue(from linux kernel development )
- tasklet && workqueue && kernel timer
- linux 中断处理 tasklet workqueue
- linux tasklet和workqueue的应用情景
- linux tasklet和workqueue的应用情景
- linux tasklet和workqueue的应用情景
- linux tasklet和workqueue的应用情景
- Linux Kernel and Driver Development Training
- tasklet和workqueue
- softirq,tasklet,workqueue
- tasklet和workqueue
- tasklet workqueue使用
- tasklet 和workqueue 总结
- tasklet与workqueue区别
- tasklet与workqueue区别
- 关于softirq/tasklet/workqueue
- workqueue,tasklet,内核定时器
- Tasklet与Workqueue
- 系统无法正确检测到盘符
- 五百年必有王者兴谭之一 泰拳凶猛之义和拳谭
- 全球首个加速手机应用开发的"零部件"市场上线
- C语言研究性学习的路线(2)
- linux 网络编程 socket
- tasklet and workqueue(from linux kernel development )
- 10 款最好的远程桌面软件
- 大型架构.net平台篇(WEB层均衡负载nginx)
- 网络游戏 - 分析 数据库服务器 安全性
- ASP.NET常用代码汇总
- socket编程头文件和常用函数
- Sql Server数据类型转换函数
- 自己动手写android手机桌面-第一篇
- SAP:查找某个请求号的传输者是谁