new linux device driver - work queue



work queue 不同於 tasklet 的 interrupt context, 是建立一個 kernel thread 來執行.
因此可以 sleep ( 使用 semaphore / block IO )
( Ref: http://nano-chicken.blogspot.com/2010/12/linux-modules73-work-queue.html )


github work schedule example




結果:
[7303.071037] hello_init: bye
[7303.071044] work_handler: data is 666
[7305.084171] work_handler: bye

留言

熱門文章