Date: Tue, 30 May 2000 13:02:22 -0400 (EDT) From: Luoqi Chen <luoqi@watermarkgroup.com> To: cp@bsdi.com Cc: arch@FreeBSD.ORG Subject: Re: Preemptive kernel on older X86 hardware Message-ID: <200005301702.e4UH2MX14070@lor.watermarkgroup.com>
next in thread | raw e-mail | index | archive | help
The two types of mutex (spinning and sleeping) are quite different. A spinning mutex is owned by a cpu, and degenerates into a no-op when ncpu == 1; on the other hand, a sleeping mutex is owned by a thread and is nontrivial for UP preemptive kernels. IMHO, it is a good idea to have a separate implementation for each type, for example, we don't need to deal with priority inversion in the spinning case (the thread that holds the spinning mutex should not be preempted). -lq > On Thu, 25 May 2000, Chuck Paterson wrote: > > > } > > } Lets use subroutines during development at least, it will make > > } things easier. I don't think anyone can argue with that :-) > > } > > > > Almost.) I certainly think that the actually locking > > stuff can be in a function but we really want to wrap the > > function in a macro so we can put tracing in. Being able > > to look at a trace and see file and line numbers for mutex > > locks and unlocks is invaluable. > > Absolutely. If using functions, it might also be a good idea to wrap with > an inline which checks for M_SPIN or M_DEF and calls a different > implementation function for each. This might allow a slightly more > efficient implementation. > > -- > Doug Rabson Mail: dfr@nlsystems.com > Nonlinear Systems Ltd. Phone: +44 20 8442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005301702.e4UH2MX14070>