Subject: Re: Interrupt, interrupt threads, continuations, and kernel lwps
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 07/01/2007 18:29:31
On Sun, Jul 01, 2007 at 04:42:53PM +0200, Manuel Bouyer wrote:
> > 
> > After some thought the best suggestion I have is to synchronize only if the
> > callout is marked with the CALLOUT_MPSAFE flag. If the code is MT safe, then
> > someone has gone over it and thought about the synchronization issues
> > involved. And I think that synchronization really only needs to happen for
> > callout_stop().
> 
> I think there is a good number of case where we don't want synchronisation
> in callout_stop() at all (either because the caller has its own
> synchronisarion, or because it doesn't care) and I think it's ortogonal to
> CALLOUT_MPSAFE.

Actually there is a synchronisation issue - it can be very hard for the
code to DTRT.

However it would be useful if callout_stop() reported back:
   1) not running
   2) cancelled
   3) couldn't cancel because active.

(3) is for the case where you don't spin waiting for completion.

	David

-- 
David Laight: david@l8s.co.uk