wait_event()\ wait_event_interruptible()\ wait_event_interruptible_timeout() and wake_up()
Valdis Kl=?utf-8?Q?=c4=93?=tnieks
valdis.kletnieks at vt.edu
Mon Jul 29 14:29:28 EDT 2019
On Mon, 29 Jul 2019 23:37:34 +0530, Muni Sekhar said:
> On Mon, Jul 29, 2019 at 11:31 PM Bharath Vedartham <linux.bhar at gmail.com> wrote:
> > Sorry to spoil the fun here. But check out what the queue data structure
> > is all about. 'wait_queue' :)
> A wait queue is a doubly linked list of wait_queue_t structures that
> hold pointers to the process task structures of the processes that are
> blocking. Each list is headed up by a wait_queue_head_t structure,
> which marks the head of the list and holds the spinlock to the list to
> prevent wait_queue_t additional race conditions
So... if you're picking the first entry off a linked list, how do you ensure that
the one you want run is the one that gets picked?
Make sure the right one is at the head of the list, of course. ;)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20190729/1f69ec5a/attachment-0001.sig>
More information about the Kernelnewbies
mailing list