![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux内核
zmxiangde_88
这个作者很懒,什么都没留下…
展开
-
内核等待队列机制原理分析
1. 等待队列数据结构等待队列由双向链表实现,其元素包括指向进程描述符的指针。每个等待队列都有一个等待队列头(wait queue head),等待队列头是一个类型为wait_queque_head_t的数据结构:struct __wait_queue_head { spinlock_t lock; struct list_head ta转载 2012-09-10 16:10:21 · 2423 阅读 · 0 评论 -
schedule_timeout
schedule_timeout()进入延时唤醒状态. 如果在延迟过程中.在通常的驱动程序中,可以以下列两种方式重新获得执行:在等待队列上调用一个 wake_up,或者 timout 超时。在这个特定实现中,没人会调用 wake_up(毕竟其它代码根本就不知道这件事),所以进程总是因 timeout 超时而被唤醒。这是一个完美有效的实现,不过,如果驱动程序无须等待其它事件,可以用一种更直接转载 2012-09-10 16:31:15 · 25767 阅读 · 0 评论 -
Linux内核的Container_of机制
在内核的原码文件 kernel.h文件中,定义了一个宏container_of,如下:/** * container_of - cast a member of a structure out to the containing structure * @ptr: the pointer to the member. * @type: the type of the container原创 2012-09-28 13:33:06 · 3362 阅读 · 0 评论