US 6,983,462 B2 | ||
Method and apparatus for serving a request queue | ||
Andrey I. Savov, Laguna Hills, Calif. (US); and Man M. Garg, Cerritos, Calif. (US) | ||
Assigned to Toshiba Corporation, (Japan); and Toshiba Tec Kabushiki Kaisha, (Japan) | ||
Filed on Mar. 15, 2002, as Appl. No. 10/98,240. | ||
Prior Publication US 2003/0177164 A1, Sep. 18, 2003 | ||
Int. Cl. G06F 9/46 (2006.01) |
U.S. Cl. 718—104 | 8 Claims |
1. A computer-implemented method for serving a request queue in a system comprising a plurality of channels, the method comprising
the steps of:
a) acquiring a blocking semaphore to determine a number of channels to acquire;
b) decrementing a blocking semaphore count in accordance with the number of channels;
c) acquiring at least one channel from which an incoming request is received;
d) receiving a request;
e) enqueueing the received request, comprising the steps of:
1) determining if the queue is full;
2) increasing a size of the queue upon a determination that the queue is full; and
3) storing the request in an empty element of the queue;
f) incrementing a dequeueing semaphore count in accordance with a number of enqueueing requests;
g) acquiring a dequeueing semaphore to determine a number of requests to dequeue;
h) decrementing a dequeueing semaphore count in accordance the number of requests to dequeue;
i) dequeueing an enqueued request, comprising the steps of
1) determining if the queue is empty; and
2) returning an array element for processing upon a determination that the queue is not empty;
j) processing a dequeued request; and
k) incrementing a blocking semaphore count in accordance with the number of channels.
|