-1

我对wait_event_interruptible 和wake_up_interruptible 的执行有疑问。

疑点1:假设在wait_event_interruptible 条件下被设为TRUE 在这种情况下进程状态直接更改为RUNNING 状态?

如果是,在这种情况下是否不需要调用 wake_up ?在这种情况下,唤醒有什么用。

疑问 2:如果另一个进程已经为处于等待状态的问题调用了 wake_up,但 wait_event_interruptible 中的条件仍然为 FALSE,在这种情况下会发生什么?

我尝试从Using wait_event_interruptible 和 wake_up_all together thread 中获取参考,但我没有找到正确的答案。

4

1 回答 1

0
  1. 当条件已经为真时,无需等待。
    wait_event* 函数也在开始实际等待之前检查条件。)
  2. 当条件仍然为假时,它将重新进入睡眠状态。
于 2013-09-29T13:15:28.970 回答