DragonFly BSD
DragonFly kernel List (threaded) for 2004-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: serializing token

From: Chuck Tuffli <chuck_tuffli@xxxxxxxxxxx>
Date: Mon, 26 Apr 2004 08:26:58 -0700

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
> something
>     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?

Chuck Tuffli
Agilent Technologies, Storage Area Networking

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]