From: "Richard B. Johnson" <root@chaos.analogic.com>
To: David Anderson <david-anderson2003@mail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Regarding task queues
Date: Tue, 1 Apr 2003 12:00:16 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.53.0304011146530.26085@chaos> (raw)
In-Reply-To: <20030401155608.27069.qmail@mail.com>
On Tue, 1 Apr 2003, David Anderson wrote:
> Hi,
>
> Is it possible for a task, run from a schedule task queue(tq_schedule)
> to sleep / block ?? Can tasks be queued to this queue from a
> interrupt context ??
>
All tasks that are queued can sleep. However you cannot ever
sleep or schedule, etc., in interrupt context. Not to worry,
though, you can wake up any tasks from interrupt context and,
of course, you can set up any pointers, etc., in the interrupt.
So, you can make a kernel thread. This is a fully-functioning
task that runs in kernel space. It can sleep "interruptible_
sleep_on()", when it is sleeping, your interrupt can give it
something to do, then wake it up "wake_up_interruptible()".
The interrupt continues as a normal interrupt and, after it
completes, the kernel will awaken your task to do whatever
you told it to do. FYI, you can "tell it to do many things"
by changing a pointer to some procedure. That pointer can,
of course, be changed in interrupt context. You just make
sure that your kernel thread is sleeping and isn't going to
be awakened while your pointer is being changed (possible in
a SMP machine, you may need a spin-lock).
This is a real easy way to do kernel-space processing based
upon some interrupt. There are other ways, too.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.
prev parent reply other threads:[~2003-04-01 16:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-01 15:56 David Anderson
2003-04-01 17:00 ` Richard B. Johnson [this message]
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=Pine.LNX.4.53.0304011146530.26085@chaos \
--to=root@chaos.analogic.com \
--cc=david-anderson2003@mail.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®