From: Brian Strand <bstrand@switchmanagement.com>
To: Wayne Cuddy <wcuddy@crb-web.com>
Cc: Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: Synchronization Techniques in 2.2 Kernel
Date: Thu, 27 Sep 2001 13:34:22 -0700 [thread overview]
Message-ID: <3BB38D4E.5000100@switchmanagement.com> (raw)
In-Reply-To: <20010927141238.E5125@crb-web.com>
Wayne Cuddy wrote:
>If I understand wait_queues correctly the process has to be sleeping before a
>wake_up call will have any effect (I.E. they are not queued). Can this be
>worked around with semaphores or some other method? I am open to ideas here.
>
>Any and all help is appreciated.
>
>Wayne
>
I apologize in advance if this is not quite right, having only done
"hello world" kernel modules thus far (plus a good deal of kernel source
browsing). I think you need to "unfold" the interruptible_sleep_on call
and do it yourself by adding current to the wait queue before checking
any cards, setting current->state = TASK_INTERRUPTIBLE, then checking
all cards and if none has data, calling schedule. When you get back
from schedule (i.e. your ISR has received data and done a wake_up) or
any card has data, remove yourself from the wait queue and set your
state to runnable. This hopefully gives you the "atomic check condition
and sleep if not satisfied" behavior.
Regards,
Brian Strand
next prev parent reply other threads:[~2001-09-27 20:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-27 19:12 Synchronization Techniques in 2.2 Kernel Wayne Cuddy
2001-09-27 20:34 ` Brian Strand [this message]
2001-09-27 21:07 ` David Woodhouse
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=3BB38D4E.5000100@switchmanagement.com \
--to=bstrand@switchmanagement.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wcuddy@crb-web.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
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