Subject: Re: timedwork
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Andrew Doran <ad@netbsd.org>
List: tech-kern
Date: 01/14/2007 14:15:51
On Sun, Jan 14, 2007 at 05:19:38PM +0900, YAMAMOTO Takashi wrote:
> > On Sat, Jan 13, 2007 at 09:11:06PM +0900, YAMAMOTO Takashi wrote:
> >
> > > > I'm thinking something like:
> > > >
> > > > callout_init(&c);
> > > > callout_setwork(&c, func, arg);
> > > > callout_schedule(&c, timeout);
> > >
> > > i implemented it. see the attached patch.
> > >
> > > once callout_setwork() is called on a callout,
> > > callout_schedule() is only legal operation on the callout.
> > > (i'm not a fan of making primitives have rich functionalities...)
> >
> > I would prefer not to have a seperate callout_setwork(), but instead
> > a flag to callout_init that can be ignored if we later do interrupts
> > as threads:
> >
> > callout_init(&foo, CALLOUT_THREAD);
> >
> > We will need to add a CALLOUT_MPSAFE flag at some point.
> >
> > Andrew
>
> what will CALLOUT_MPSAFE do, if softclock() is called with kernel_lock held?
We will need to change it so that the kernel lock isn't taken until
softclock() - which also means having a flag for softintr_establish().
Andrew