Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Muni Sekhar <munisekharrms@gmail.com>
Cc: Bharath Vedartham <linux.bhar@gmail.com>,
	kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: wait_event()\ wait_event_interruptible()\ wait_event_interruptible_timeout() and wake_up()
Date: Mon, 29 Jul 2019 14:29:28 -0400
Message-ID: <22273.1564424968@turing-police> (raw)
In-Reply-To: <CAHhAz+gCJ4KrvO87D1gE01cdmdzya22RGZwh3Rz78OtZEn641w@mail.gmail.com>

[-- Attachment #1.1: Type: text/plain, Size: 785 bytes --]

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@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. ;)


[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 17:18 Muni Sekhar
2019-07-29 17:28 ` Greg KH
2019-07-29 18:01 ` Bharath Vedartham
2019-07-29 18:07   ` Muni Sekhar
2019-07-29 18:29     ` Valdis Klētnieks [this message]
2019-07-29 18:27 ` Valdis Klētnieks
2019-07-30  1:59   ` Muni Sekhar
2019-08-06  8:45   ` Muni Sekhar
2019-08-06 11:42     ` Valdis Klētnieks
2019-08-06 12:00       ` Muni Sekhar
2019-08-06 12:26         ` Greg KH

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22273.1564424968@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=linux.bhar@gmail.com \
    --cc=munisekharrms@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox