serializing token

Chuck Tuffli chuck_tuffli at agilent.com
Mon Apr 26 08:30:05 PDT 2004


On Sun, Apr 25, 2004 at 02:17:45AM -0400, Matthew Dillon wrote:
[snip]
> :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





More information about the Kernel mailing list