Claims
- 1. In a circular queue having N fixed timer entries (FTEs) and a “Current Timer Index”, a method for dynamically increasing the capacity of said circular queue by M comprising the steps of:(a) extending a pointer array containing said circular queue by M; (b) copying the first “Current Timer Index” entries; (c) allocating M FTEs; (d) linking said M FTEs within said circular queue; (e) adjusting a “TICK ADJUST” value.
- 2. The method of claim 1 wherein step (b) includes the steps of:(b1) initializing a DESTINATION (DEST) index into said pointer array at index N; (b2) initializing a SOURCE (SRC) index into said pointer array at index 0; (b3) iterating through indices of said pointer array and copying values from said SOURCE (SRC) index to said DESTINATION (DEST) index for said “Current Timer Index” number of times.
- 3. The method of claim 1 wherein step (d) includes the steps of:(d1) saving addresses for said M FTEs in said pointer array; (d2) doubly-linking said M FTEs into a linear queue LQ2; (d3) converting the existing circular queue to a linear queue LQ1 and joining a linear queue LQ1 consisting of said N FTEs with said linear queue LQ2 of M FTEs into a linear queue LQ3; (d4) converting said linear queue LQ3 into a circular queue.
- 4. The method of claim 3 wherein step (d1) includes the step of:(d1a) determining a first element for said M FTEs; (d1b) iterating through indices of said pointer array starting with said first element and assigning an index to each of said M FTEs.
- 5. The method of claim 3 wherein step (d2) includes the step of:(d2a) determining a first element for said M FTEs; (d2b) iterating through indices of said pointer array starting with said first element and assigning a previous pointer and a next pointer for each of said M FTEs.
- 6. The method of claim 3 wherein step (d3) includes the step of:(d3a) setting a previous pointer for a current FTE within said pointer array at “Current Timer Index” to nil; (d3b) setting a next pointer for a previous FTE which precedes said current FTE to nil; (d3c) setting said next pointer for said previous FTE to point to an intended first element of said linear queue LQ2; (d3d) setting a previous pointer for said intended first element to point to said previous FTE.
- 7. The method of claim 3 wherein step (d4) includes the step of:(d4a) setting a previous pointer for an intended first element of LQ3 to an intended last element of LQ3; (d4b) setting a next pointer for said last element to said first element.
- 8. The method of claim 1 wherein step (e) includes the steps of:(e1) calculating (a “Current Time In Ticks” plus said “Tick Adjust” value) mod N and assigning it to an I1 variable; (e2) incrementing N by M; (e3) calculating said “Current Time In Ticks” mod N and assigning it to an I2 variable; (e4) calculating said I1 value minus said I2 value and assigning it to said “Tick Adjust” variable; (e5) calculating (said “Current Time In Ticks” plus said “Tick Adjust”) mod N and assigning it to said “Current Timer Index” for all subsequent requests for said “Current Timer Index”.
- 9. In a circular queue of N Fixed Timer Entries and a “Current Timer Index”, a system for expanding the number of Fixed Timer Entries to N+M, where N and M are integers, comprising:(a) means to break the sequence of FTEs in said circular queue of N (FTEs) Fixed Timer Entries into a linear queue; (b) means to add M FTEs to the existing N FTEs; (c) means to re-establish the circular queue to form an enlarged circular queue of N+M total Fixed Timer Entries.
CROSS REFERENCE TO RELATED APPLICATIONS
This application is related to co-pending applications U.S. Ser. No. 09/602,692 entitled “System and Method For Optimizing Insertions For Timer Queue Operations” and U.S. Ser. No. 09/602,693 entitled “Deletion System And Method For Removing Transient Timer Entries From A Circular Queue” and is incorporated herein by reference.
US Referenced Citations (5)
Number |
Name |
Date |
Kind |
5502719 |
Grant et al. |
Mar 1996 |
A |
5758137 |
Armstrong et al. |
May 1998 |
A |
6032207 |
Wilson |
Feb 2000 |
A |
6647505 |
Dangi et al. |
Nov 2003 |
B1 |
6714959 |
Dangi et al. |
Mar 2004 |
B1 |