linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Richard B. Johnson" <root@chaos.analogic.com>
To: jt@hpl.hp.com
Cc: Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Jeff Garzik <jgarzik@mandrakesoft.com>
Subject: Re: Killing tasklet from interrupt
Date: Mon, 18 Mar 2002 15:38:29 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.3.95.1020318153650.29558B-100000@chaos.analogic.com> (raw)
In-Reply-To: <20020318115313.A26490@bougret.hpl.hp.com>

On Mon, 18 Mar 2002, Jean Tourrilhes wrote:

> 	Hi,
> 
> 	I'm trying to use tasklets and I've come across one problem. I
> need to kill a tasklet from a timer, and I wonder if it's legal.
> 
> 	Code :
> 	-> User close IrDA TSAP and goes away
> 		-> LSAP not clean, more work to do
> 			-> Schedule timer in one second
> 	-> Timer
> 		-> If LSAP clean and nothing to do
> 			-> Kill tasklet
> 			-> Destroy LSAP
> 		-> Else re-shedule timer
> 
> 	The tasklet is used in the Rx path, so may be scheduled after
> the user close the TSAP. The TSAP may interface to the socket code, to
> the TTY code, to the Ethernet code or the PPP code, so we are not even
> guaranteed that the TSAP closure is done from a user context (fun,
> fun, fun).
> 	To be fair, the timer API is much more versatile in that
> respect. What I think I need is a tasklet_try_kill()...
> 
> 	Regards,
> 
> 	Jean

You have the tasklet kill itself the next time it executes. Set some
flag so it knows it should give up its timer-slot and expire. The
interrupt sets the flag. It doesn't do anything else.


Cheers,
Dick Johnson

Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).

                 Windows-2000/Professional isn't.


  reply	other threads:[~2002-03-18 20:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-18 19:53 Killing tasklet from interrupt Jean Tourrilhes
2002-03-18 20:38 ` Richard B. Johnson [this message]
2002-03-18 20:57   ` Jean Tourrilhes
2002-03-18 23:20     ` Maksim Krasnyanskiy
2002-03-18 23:33       ` Jean Tourrilhes
2002-03-19 19:41         ` Maksim Krasnyanskiy
2002-03-22 17:56           ` Maksim Krasnyanskiy

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.3.95.1020318153650.29558B-100000@chaos.analogic.com \
    --to=root@chaos.analogic.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jgarzik@mandrakesoft.com \
    --cc=jt@hpl.hp.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;
as well as URLs for NNTP newsgroup(s).