NVIDIA Interview Question
Development Support Engineerswake_up_interruptible() can wake only those processes which are put to sleep using wait_event_interruptible(), i.e. the processes which are put to sleep with its state as TASK_INTERRUPTIBLE.
wake_up() wakes up all the processes which is waiting for that event.
Pay attention to the fact that comment by Yo is wrong. Citing from LDD3, "The end result (of wake_up, ed.) is that processes performing exclusive waits are awakened one at a time, in an orderly manner, and do not create thundering herds. The kernel still wakes up all nonexclusive waiters every time, however."
wake_up - wakes exactly one exclusive sleeping process in TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE state from the wait queue
- Channa August 03, 2010wake_up_interruptible - wakes only one exclusive sleeping process in TASK_INTERRUPTIBLE from the wait queue
Wake_up_interruptible might be used in semaphore which wakes up only one process waiting for the signal from the wait queue. If you need to wake up only processes which are waiting on an event, then wake_up_interruptible must be used.
To generally wake up all the processes to some activity such as device I/O then wake_up has to be used.
I might be wrong, but this what I understand.