wait_event()\ wait_event_interruptible()\ wait_event_interruptible_timeout() and wake_up()
Muni Sekhar
munisekharrms at gmail.com
Mon Jul 29 14:07:34 EDT 2019
On Mon, Jul 29, 2019 at 11:31 PM Bharath Vedartham <linux.bhar at gmail.com> wrote:
>
> On Mon, Jul 29, 2019 at 10:48:57PM +0530, Muni Sekhar wrote:
> > Hi All,
> >
> > Let us assume that multiple processes are waiting on wait_event()\
> > wait_event_interruptible()\ wait_event_interruptible_timeout(), which
> > process gets woken up on calling wake_up()??
> >
> > I presume wake_up() picks one process, but is there any algorithm to
> > pick which process?
> >
> >
> > --
> > Thanks,
> > Sekhar
> 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
>
> Thank you
> Bharath
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
--
Thanks,
Sekhar
More information about the Kernelnewbies
mailing list