From: Andrew Morton <akpm@osdl.org>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu
Subject: Re: [PATCH] add unschedule_delayed_work to the workqueue API
Date: Mon, 18 Oct 2004 15:02:17 -0700 [thread overview]
Message-ID: <20041018150217.0fbf714f.akpm@osdl.org> (raw)
In-Reply-To: <1098136049.2792.329.camel@mulgrave>
James Bottomley <James.Bottomley@SteelEye.com> wrote:
>
> > > OK, found it in the headers, sorry .. it's not synchronous, so it can't
> > > really be used in most of the cases where we use del_timer_sync().
> >
> > cancel_delayed_work() will tell you whether it successfully cancelled the
> > timer. If it didn't, you should run flush_workqueue() to wait on the final
> > handler. The combination of the two is synchronous.
>
> Right, but it potentially does too much work for my purposes.
Are you sure?
> I want to
> cancel the work if it's cancellable or wait for it if it's already
> executing. I don't want to have to wait for all the work in the queue
> just because the timer fired and it got added to the workqueue schedule.
The probability that the handler is running when you call
cancel_delayed_work() is surely very low. And the probability that there
is more than one thing pending in the queue at that time is also low.
Multiplying them both together, then multiplying that by the relative
expense of the handler makes me say "show me" ;)
next prev parent reply other threads:[~2004-10-18 21:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-18 16:31 [PATCH] add unschedule_delayed_work to the workqueue API James Bottomley
2004-10-18 21:25 ` Andrew Morton
2004-10-18 21:26 ` James Bottomley
2004-10-18 21:29 ` James Bottomley
2004-10-18 21:43 ` Andrew Morton
2004-10-18 21:47 ` James Bottomley
2004-10-18 22:02 ` Andrew Morton [this message]
2004-10-18 22:15 ` James Bottomley
2004-10-18 22:57 ` Andrew Morton
2004-10-18 23:24 ` James Bottomley
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=20041018150217.0fbf714f.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=James.Bottomley@SteelEye.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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