C H A P T E R 5 |
Fast Queue API |
This chapter describes the Fast Queue API functions. Topics include:
The Fast Queue API provide a facility where threads can exchange or pass data in a first-in-first-out (FIFO) order. This API provides routines for creating and using fast queues, a fast communication mechanism between two or more threads. The fast queues are based on circular buffers and is an advantage over teja queues that are for one consumer and one producer. The fast queues are poll-driven and are more efficient for high packet rates. The fast queue API is not thread safe and need to be protected with locks when they are used by more than one consumer or producer.
The API functions are defined in fastq.h located in the src/dev/net/include directory of the SUNWndps package.
This function creates a new instance of the fast queue.
fastq_t fastq_create(size_t size)
This function enqueues a node pointer into the fast queue. If -1 is returned, the queue is either full or some other error has occurred.
This function dequeues a pointer to a node from the queue.
This function returns a value which is the depth of the queue at a given point of time.
This function checks if the queue is empty.
This function checks if the queue is full.
Copyright © 2008, Sun Microsystems, Inc. All Rights Reserved.