public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anders Peter Fugmann <afu@fugmann.dhs.org>
To: chuckw@ieee.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: Looking for comments on Bottom-Half/Tasklet/SoftIRQ
Date: Sun, 19 Aug 2001 18:59:22 +0200	[thread overview]
Message-ID: <3B7FF06A.4090606@fugmann.dhs.org> (raw)
In-Reply-To: <20010818231704.A2388@ieee.org>


chuckw@ieee.org wrote:
> Greetings,
> 	I was reading the unreliable guide to kernel hacking and was looking for
> a little clarification on something.  2 Bottom halves cannot run at the same
> time, why? 

Per linux definition of bottom halves, there can only run one buttom 
half at one system wide. But dont use those - They are old and waists 
resources. Try tasklets instead. Multible tasklets can run in parrallel 
(but not the same tasklet)

> 	Also, could someone give me an example of a service which is a bottom half/
> tasklet/SoftIRQ?
Simple.

Imagine some hardware that generates interrupts.
Now we want to write a driver that keeps the hardware busy, so we 
implement a top half handler (IRQ-handler), and let it retrieve som data 
from the hardware. Instead of processing it right away, we shedule a 
tasklet to do that job. This way we can handle more interrupts/sec from 
the card, and the hardware is kept busy.


To summerize.
Buttom halves are the strictest (only one at a time.)
Takslets can run in parralel, but still no need to worry about reentrant 
code.
SoftIrq give no guarrentee at all, and should be used with great care
(code need to be reentrant).

Also try to readLinux device drivers by  A. Rubini:
http://www.xml.com/ldd/chapter/book/index.html

Hope it helps.
Anders Fugmann

> 
> Thanks in advance,
> Chuck
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 



  reply	other threads:[~2001-08-19 16:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-19  3:17 Looking for comments on Bottom-Half/Tasklet/SoftIRQ chuckw
2001-08-19 16:59 ` Anders Peter Fugmann [this message]
2001-08-19  5:35   ` chuckw
2001-08-19 19:01     ` Anders Peter Fugmann
2001-08-19 10:57       ` chuckw
2001-08-20 16:04     ` george anzinger
2001-08-20 12:39       ` chuckw
2001-08-20 21:05       ` Anders Peter Fugmann

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=3B7FF06A.4090606@fugmann.dhs.org \
    --to=afu@fugmann.dhs.org \
    --cc=chuckw@ieee.org \
    --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