DragonFly kernel List (threaded) for 2005-04
Re: DFly Tokens
On Mon, Apr 04, 2005 at 02:19:15AM +0000, Terry Tree wrote:
> Is it possible to pull in some of the same work that FreeBSD has done
> using mutex locking into DragonFlyBSD using Tokens ? E.G. Reading
> through the status log on the web site I haven't seen anything done
> yet with the device drivers. Is it possible to use tokens inside
> those code paths or is there already another chosen method for this ?
The biggest difference between tokens and mutexes is that tokens allows
blocking, but loose the atomicy, and mutexes normally don't allow to
block to prevent dead locks.
It is important to consider what device drivers have to serialize
and how they are accessed. The two parts are the high-level kernel
interface and the low-level interrupt handler. You have to serialize
all high-level operations and all low-level changes with each other.
One way to achieve this is via a mutex for all softc accesses. A different
way is to serialize all accesses on one CPU and use a thread to handle
the accesses. We most likely end up with something like that, but
the details are still fuzzy.