I can find many examples regarding wait_queue_head
.
It works as a signal, create a wait_queue_head
, someone
can sleep using it until someother kicks it up.
But I can not find a good example of using wait_queue
itself, supposedly very related to it.
Could someone gives example, or under the hood of them?
From Linux Device Drivers:
Take a look at A Deeper Look at Wait Queues part.
The internals of the data structures involved in wait queues:
Update: for the users who think the image is my own - here is one more time the link to the Linux Device Drivers where the image is taken from
Wait queue is simply a list of processes and a lock.
wait_queue_head_t
represents the queue as a whole. It is the head of the waiting queue.wait_queue_t
represents the item of the list - a single process waiting in the queue.