mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexey Shinkin" <alexshinkin@hotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: questions on wait_event ...
Date: Fri, 23 Dec 2005 07:46:17 +0600	[thread overview]
Message-ID: <BAY16-F260F9C6F509BFC683D3A6AF330@phx.gbl> (raw)
In-Reply-To: <1135300240.12761.27.camel@localhost.localdomain>


Look:

We call wait_event() , condition is FALSE at the moment  :

    do {
         if (condition)
                 break;
    /* and here we have condition changed  to TRUE  */
    /*  process is NOT in any wait queue yet  */
    /*  then  unroll     __wait_event(wq, condition);        */

     do {							DEFINE_WAIT(__wait);					for (;;) {
	prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE);

          /* at this point condition is TRUE , process is in a wait queue 
and its state is
             TASK_UNINTERRUPTIBLE.   If  rescheduling happens now the 
process will asleep,
              despite of condition is  TRUE . And will not be woken up until 
next wake_up happens
              Is that correct ?  */

	if (condition)						     break;
                    schedule();
        }
   finish_wait(&wq, &__wait);
} while (0)
   /*  end of unroll __wait_event*/

} while (0)

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


  reply	other threads:[~2005-12-23  1:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5mIFB-6PS-33@gated-at.bofh.it>
2005-12-23  0:16 ` Robert Hancock
2005-12-23  0:51   ` Alexey Shinkin
2005-12-23  1:10     ` Steven Rostedt
2005-12-23  1:46       ` Alexey Shinkin [this message]
2005-12-23 20:48         ` Steven Rostedt
2005-12-23  0:04 Alexey Shinkin

Reply instructions:

You may reply publicly 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=BAY16-F260F9C6F509BFC683D3A6AF330@phx.gbl \
    --to=alexshinkin@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®