Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
From: Greg KH <greg@kroah.com>
To: Muni Sekhar <munisekharrms@gmail.com>
Cc: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>,
	kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: wait_event()\ wait_event_interruptible()\ wait_event_interruptible_timeout() and wake_up()
Date: Tue, 6 Aug 2019 14:26:40 +0200
Message-ID: <20190806122640.GA30458@kroah.com> (raw)
In-Reply-To: <CAHhAz+j7yE5xy3rYG-gda0iEM0N72wu=+rctuXrqFOv3bCCmrw@mail.gmail.com>

On Tue, Aug 06, 2019 at 05:30:43PM +0530, Muni Sekhar wrote:
> On Tue, Aug 6, 2019 at 5:12 PM Valdis Klētnieks <valdis.kletnieks@vt.edu> wrote:
> >
> > On Tue, 06 Aug 2019 14:15:53 +0530, Muni Sekhar said:
> >
> > > If they do different things, does the waiting threads wakeup order is
> > > the same in which they were enqueued (FIFO order)?
> >
> > You missed the point - if you have (for example) something that's waiting for
> > mouse I/O and something that's waiting for a network packet, under what
> > conditions will they be using the same wait event?
> In this example they won't wait on the same wait event. Let us
> consider buggy code is written like that and more than one
> process(they do different things) waiting on the same wait event which
> process gets woken up? Is the process at the head of the list?

Again, try it and see, it is trivial to do this test.

Also, when you write buggy code, you get buggy results :)

thanks,

greg k-h

_______________________________________________
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
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 [this message]

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=20190806122640.GA30458@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=munisekharrms@gmail.com \
    --cc=valdis.kletnieks@vt.edu \
    /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


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