DragonFly kernel List (threaded) for 2004-04
Re: serializing token
On Sun, Apr 25, 2004 at 02:17:45AM -0400, Matthew Dillon wrote:
> :Let's assume for a minute that the above code is a consumer on a
> :work-queue and that the "if (someglobal)" evaluates true if there
> :is work to be done.
> :Would this "gettoken" "reltoken" usage be suitable to support a
> :consumer on a work queue?
> It would be suitable for manipulating the work queue to pull
> off of it, as long as you intend to allow other consumers to also
> pull things off the work queue while your consume is potentially
> blocked in the midst of doing the work that it had pulled off.
Is it not suitable for protection between the producer and consumer?
Specifically, I have a driver that shares an event queue between the
interrupt handler and a kernel thread (interrupt creates events,
thread processes them). What is the prefered DFly scheme to protect
the queue's head/tail pointers?
Agilent Technologies, Storage Area Networking