mention msleep() in porting_drivers.txt

Jeffrey Hsu hsu at dragonflybsd.org
Sun Jan 6 12:48:43 PST 2008


Well, we do have a msleep() function.  It atomically releases a
lock before sleeping to ensure that no wakeup is missed.  It is the
same as the msleep() function that's currently in FreeBSD, except
in FreeBSD it release a mutex lock and in DragonFly it releases a
spin lock.  For short critical sections that don't block, substituting
a spinlock and msleep() for a mutex lock and msleep() would be the
most direct way to convert between FreeBSD and DragonFly.

For more complicated critical sections, it might be better to pursue
a different MP-safety strategy entirely, such as per-cpu data along with
crit_enter()/crit_exit().  This has lower overhead and also parallelizes,
rather than serializes, the work load.

							Jeffrey







More information about the Submit mailing list