I want to set an flag bit CALLOUT_PROCESSING in callout.c_flags, before softclock() releases callout_lock and start requesting callout.c_func(), so callout_stop can find that callout is processing by softclock and wait, after softclock processed the callout, it resets the flag and wakeup callout_stop thread, of course, if callout_stop is being called in softclock() thread, it should avoid waiting, it is easy to detect.
David Xu ----- Original Message ----- From: "John Baldwin" <[EMAIL PROTECTED]> To: "David Xu" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; "Julian Elischer" <[EMAIL PROTECTED]> Sent: Tuesday, July 09, 2002 3:27 AM Subject: RE: Timeout and SMP race > > On 04-Jul-2002 David Xu wrote: > > while we are getting rid of Giant, current race condition between softclock() > > and callout_stop() is unacceptable. the race causes two many places in source > > code would be modified to fit this new behaviour, besides this, everywhere > > callout_stop() is used need to hold sched_lock and do a mi_switch() and > > modify td_flags is also unacceptable, this SMP race should be resolved in > > kern_timeout.c. > > How would you resolve it while still preserving the existing semantics? > Saying "this race should be resolved" doesn't explain how you would go about > resolving it. It's a lot harder than it looks. > > -- > > John Baldwin <[EMAIL PROTECTED]> <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ __________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message