【发布时间】:2014-06-16 08:12:43
【问题描述】:
我看到内核源码中fs/eventpoll.c是这样写的:
static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
int maxevents, long timeout)
{
....
init_waitqueue_entry(&wait, current);
__add_wait_queue_exclusive(&ep->wq, &wait); // *** NB
....
}
“独占”是否意味着只有一个等待项(用户空间中的进程或线程)会被唤醒?
但是当我写一些测试代码时,我看到thundering herd problem仍然存在。
为什么不能解决?谢谢!
【问题讨论】:
标签: c linux concurrency