IP Library Granted Patent US 7,716,668
Granted Patent B2
US 7,716,668 · App. 10/735,678 · Granted May 11, 2010

System and method for scheduling thread execution

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,716,668
App. No.
10/735,678
Granted
May 11, 2010
Kind
B2
Abstract

A circular array structure is maintained having multiple time slots, where each time slot corresponds to a timeslice during which CPU resources are allocated to a particular thread. The time slots in the circular array include a queue of threads scheduled for execution during that time slot. A pointer index and an array of threads requesting immediate CPU resource allocation are maintained. A currently executing thread is suspended, and a next time slot during which the currently executing thread should resume execution is calculated. The suspended currently executing thread is appended to the queue of threads scheduled for execution at the calculated time slot. The pointer index is undated to point to the identified next sequential non-empty time slot. Any contents of the indexed time slot is appended to the array of threads requesting immediate CPU resource allocation. The thread at the top of the array is removed and activated.

Claims (139)

1. A method for scheduling thread execution, comprising:

maintaining a circular array structure having a plurality of time slots therein, wherein each of the plurality of time slots corresponds to a timeslice during which CPU resources are allocated to a particular thread;

configuring each time slot in the circular array to include a queue of threads scheduled for execution during that time slot;

maintaining a pointer index for referencing one time slot in the circular array and whereby advancement through the circular array is provided by advancing the pointer index;

maintaining an array of threads requesting immediate CPU resource allocation based on the queue of threads;

calculating a next time slot during which a currently executing thread should next resume execution;

appending the currently executing thread to the queue of threads scheduled for execution at the calculated time slot;

identifying a next sequential non-empty time slot containing a queue of threads scheduled for execution during that time slot;

updating the pointer index to point to the identified next sequential non-empty time slot;

appending any contents of the indexed time slot to the array of threads requesting immediate CPU resource allocation;

removing the thread at a top of the array of threads requesting immediate CPU resource allocation;

determining whether the thread at the top of the array of threads requesting immediate CPU resource allocation is identical to the currently executing thread;

maintaining execution of the currently executing thread for the following time slot if it is determined that the thread at the top of the array of threads requesting immediate CPU resource allocation is identical to the currently executing thread;

suspending the currently executing thread; and

activating the thread at the top of the array of threads requesting immediate CPU resource allocation if it is determined that the thread at the top of the array of threads requesting immediate CPU resource allocation is not identical to the currently executing thread.

2. The method of claim 1 , wherein each timeslice is between 10 and 100 microseconds.

3. The method of claim 1 , wherein the array of threads requesting immediate CPU resource allocation includes a first-in-first-out (FIFO) structure.

4. The method of claim 1 , wherein the step of suspending the currently executing thread includes:

receiving a self-suspend request from the currently executing thread.

5. The method of claim 4 , further comprising:

advancing the index pointer by one time slot;

removing a list of any threads to be executed at the indexed time slot and appending them to the array of threads requesting immediate CPU resource allocation; determining whether the array of threads requesting immediate CPU resource allocation is empty;

returning to the step of advancing the index pointer by one slot if it is determined that the array of threads requesting immediate CPU resource allocation does not contain any threads; and

removing and activating the thread at the top of the array of threads requesting immediate CPU resource allocation if it is determined that the array of threads requesting immediate CPU resource allocation is not empty.

6. The method of claim 1 , further comprising:

receiving an external event interrupt requesting CPU resource allocation for a new thread;

calculating a next time slot during which the currently executing thread should next resume execution;

determining whether the external event interrupt is requesting immediate CPU resource allocation;

appending the new thread to a queue on a time slot on the circular array if it is determined that the external event interrupt is not requesting immediate CPU resource allocation;

determining a type of thread currently executing;

activating the new thread if no thread is currently executing;

performing the following steps if it is determined that a non-idle thread is currently executing:

suspending the currently executing thread;

appending the currently executing thread to the end of the array of threads requesting immediate CPU resource allocation; and

activating the new thread;

performing the following steps if it is determined that an idle thread is currently executing:

suspending the currently executing thread; and

activating the new thread.

7. A method for scheduling thread execution, comprising:

maintaining a plurality of circular array structures associated with a plurality of discrete thread priorities, each having a plurality of time slots therein, wherein each of the plurality of time slots corresponds to a timeslice during which CPU resources are allocated to a particular thread;

configuring each time slot in each of the circular arrays to include a queue of threads scheduled for execution during that time slot;

maintaining at least one pointer index for referencing one time slot in each of the circular arrays, whereby advancement through the circular arrays is provided by advancing the pointer index;

maintaining an array of threads requesting immediate CPU resource allocation for each of the plurality of circular arrays;

assigning each thread to be executed a specific priority;

incrementing the index pointer by one slot;

removing, for each of the plurality of circular arrays, each queue of threads for the indexed time slot;

appending each removed thread to the array of threads requesting immediate CPU resource allocation associated with its respective circular array;

determining whether the array of threads requesting immediate CPU resource allocation associated with a first circular array contains any threads;

proceeding to a next circular array if the array of threads requesting immediate CPU resource allocation is empty;

extracting a top thread if the array of threads requesting immediate CPU resource allocation contains any threads;

determining whether a priority of the top thread is greater than a priority of the currently executing thread;

calculating a time for next execution of the top thread if it is determined that the priority of the top thread is not greater than the priority of the currently executing thread; performing the following steps if it is determined that the priority of the top thread is greater than a priority of the currently executing thread:

suspending the currently executing thread;

activating the top thread; and

calculating the time of next execution for the suspended thread;

determining whether each of the array of threads requesting immediate CPU resource allocation associated with each of the circular arrays has been processed; and

proceeding to the next array of threads requesting immediate CPU resource allocation if it is determined that not all arrays of threads requesting immediate CPU resource allocation have been processed.

8. The method of claim 7 , wherein each of the plurality of circular arrays corresponds to one of four assigned priority levels: a non-real-time priority; a soft-real-time priority; a hard-real-time priority; and a critical-real-time priority.

9. The method of claim 7 , further comprising:

receiving an external event interrupt requesting CPU resource allocation for a new thread;

calculating a next time slot during which the currently executing thread should next resume execution;

determining whether the external event interrupt is requesting immediate CPU resource allocation;

appending the new thread to a queue on a time slot on the circular array if it is determined that the external event interrupt is not requesting immediate CPU resource allocation;

determining whether a priority of the new thread is greater than a priority of the currently executing thread;

appending the new thread to the end of the array of threads requesting immediate CPU resources for the associated priority if it is determined that the priority of the new thread is not greater than the priority of the currently executing thread; and performing the following steps if it is determined that the priority of the new thread is greater than the priority of the currently executing thread:

suspending the currently executing thread;

calculating the time for next execution for the currently executing thread appending the currently executing thread to array associated with the calculated time slot; and

activating the new thread.

10. A computer-readable storage medium storing a program for scheduling thread execution, the program, when executed by a processor, causing a computer to perform:

maintaining a plurality of circular array structures associated with a plurality of discrete thread priorities, each having a plurality of time slots therein, wherein each of the plurality of time slots corresponds to a timeslice during which CPU resources are allocated to a particular thread;

configuring each time slot in each of the circular arrays to include a queue of threads scheduled for execution during that time slot;

maintaining at least one pointer index for referencing one time slot in each of the circular arrays, whereby advancement through the circular arrays is provided by advancing the pointer index;

maintaining an array of threads requesting immediate CPU resource allocation for each of the plurality of circular arrays;

assigning each thread to be executed a specific priority;

incrementing the index pointer by one slot;

removing, for each of the plurality of circular arrays, each queue of threads for the indexed time slot;

appending each removed thread to the array of threads requesting immediate CPU resource allocation associated with its respective circular array;

determining whether the array of threads requesting immediate CPU resource allocation associated with a first circular array contains any threads;

proceeding to a next circular array if the array of threads requesting immediate CPU resource allocation is empty;

extracting a top thread if the array of threads requesting immediate CPU resource allocation contains any threads;

determining whether a priority of the top thread is greater than a priority of the currently executing thread;

calculating a time for next execution of the top thread if it is determined that the priority of the top thread is not greater than the priority of the currently executing thread;

performing the following steps if it is determined that the priority of the top thread is greater than a priority of the currently executing thread:

suspending the currently executing thread;

activating the top thread; and

calculating the time of next execution for the previously executing thread;

determining whether each of the array of threads requesting immediate CPU resource allocation associated with each of the circular arrays has been processed; and

proceeding to the next array of threads requesting immediate CPU resource allocation if it is determined that not all arrays of threads requesting immediate CPU resource allocation have been processed.

11. The computer-readable storage medium of claim 10 , wherein each of the plurality of circular arrays corresponds to one of four assigned priority levels: a non-real-time priority; a soft-real-time priority; a hard-real-time priority; and a critical-real-time priority.

12. The computer-readable storage medium of claim 10 , the program further causing the computer to perform:

receiving an external event interrupt requesting CPU resource allocation for a new thread;

calculating a next time slot during which the currently executing thread should next resume execution;

determining whether the external event interrupt is requesting immediate CPU resource allocation;

appending the new thread to a queue on a time slot on the circular array if it is determined that the external event interrupt is not requesting immediate CPU resource allocation;

determining whether a priority of the new thread is greater than a priority of the currently executing thread;

appending the new thread to the end of the array of threads requesting immediate CPU resources for the associated priority if it is determined that the priority of the new thread is not greater than the priority of the currently executing thread; and

performing the following steps if it is determined that the priority of the new thread is greater than the priority of the currently executing thread:

suspending the currently executing thread;

calculating the time for next execution for the currently executing thread

appending the currently executing thread to array associated with the calculated time slot; and

activating the new thread.

13. A computer-readable storage medium storing a program for scheduling thread execution, the program, when executed by a processor, causing a computer to perform:

maintaining a circular array structure having a plurality of time slots therein, wherein each of the plurality of time slots corresponds to a timeslice during which CPU resources are allocated to a particular thread;

configuring each time slot in the circular array to include a queue of threads scheduled for execution during that time slot;

maintaining a pointer index for referencing one time slot in the circular array and whereby advancement through the circular array is provided by advancing the pointer index;

maintaining an array of threads requesting immediate CPU resource allocation;

calculating a next time slot during which a currently executing thread should next resume execution;

appending the currently executing thread to the queue of threads scheduled for execution at the calculated time slot;

identifying a next sequential non-empty time slot;

updating the pointer index to point to the identified next sequential non-empty time slot;

appending any contents of the indexed time slot to the array of threads requesting immediate CPU resource allocation;

removing the thread at a top of the array of threads requesting immediate CPU resource allocation;

determining whether the thread at the top of the array of threads requesting immediate CPU resource allocation is identical to the currently executing thread;

maintaining execution of the currently executing thread for the following time slot if it is determined that the thread at the top of the array of threads requesting immediate CPU resource allocation is identical to the currently executing thread;

suspending the currently executing thread; and

activating the thread at the top of the array of threads requesting immediate CPU resource allocation if it is determined that the thread at the top of the array of threads requesting immediate CPU resource allocation is not identical to the currently executing thread.

14. The computer-readable storage medium of claim 13 , wherein each timeslice is between 10 and 100 microseconds.

15. The computer-readable storage medium of claim 13 , wherein the array of threads requesting immediate CPU resource allocation includes a first-in-first-out (FIFO) structure.

16. The computer-readable storage medium of claim 13 , wherein suspending the currently executing thread further comprises receiving a self-suspend request from the currently executing thread.

17. The computer-readable storage medium of claim 16 , further causing the computer to perform:

advancing the index pointer by one time slot;

removing a list of any threads to be executed at the indexed time slot and appending them to the array of threads requesting immediate CPU resource allocation;

determining whether the array of threads requesting immediate CPU resource allocation is empty;

returning to the step of advancing the index pointer by one slot if it is determined that the array of threads requesting immediate CPU resource allocation does not contain any threads; and

removing and activating the thread at the top of the array of threads requesting immediate CPU resource allocation if it is determined that the array of threads requesting immediate CPU resource allocation is not empty.

18. The computer-readable storage medium of claim 13 , further causing the computer to perform:

receiving an external event interrupt requesting CPU resource allocation for a new thread;

calculating a next time slot during which the currently executing thread should next resume execution;

determining whether the external event interrupt is requesting immediate CPU resource allocation;

appending the new thread to a queue on a time slot on the circular array if it is determined that the external event interrupt is not requesting immediate CPU resource allocation;

determining the type of thread currently executing;

activating the new thread if no thread is currently executing;

performing the following steps if it is determined that a non-idle thread is currently executing:

suspending the currently executing thread;

appending the currently executing thread to the end of the array of threads requesting immediate CPU resource allocation; and

activating the new thread;

performing the following steps if it is determined that an idle thread is currently executing:

suspending the currently executing thread; and

activating the new thread.

Assignments (9)
SECURITY INTEREST Recorded Sep 27, 2017
From: SYNAPTICS INCORPORATED
To: WELLS FARGO BANK, NATIONAL ASSOCIATION
Reel/Frame 044037/0896 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 7, 2017
From: CONEXANT SYSTEMS, LLC
To: SYNAPTICS INCORPORATED
Reel/Frame 043786/0267 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 21, 2017
From: BROOKTREE BROADBAND HOLDING, INC.
To: CONEXANT SYSTEMS, LLC
Reel/Frame 043293/0711 →
RELEASE OF SECURITY INTEREST Recorded May 6, 2016
From: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A.
To: CONEXANT SYSTEMS, INC.; CONEXANT, INC.; CONEXANT SYSTEMS WORLDWIDE, INC.; BROOKTREE BROADBAND HOLDING, INC.
Reel/Frame 038631/0452 →
SECURITY AGREEMENT Recorded Mar 11, 2010
From: CONEXANT SYSTEMS, INC.; CONEXANT SYSTEMS WORLDWIDE, INC.; CONEXANT, INC.; BROOKTREE BROADBAND HOLDING, INC.
To: THE BANK OF NEW YORK, MELLON TRUST COMPANY, N.A.
Reel/Frame 024066/0075 →
RELEASE OF SECURITY INTEREST Recorded Mar 1, 2010
From: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A. (FORMERLY, THE BANK OF NEW YORK TRUST COMPANY, N.A.)
To: BROOKTREE BROADBAND HOLDING, INC.
Reel/Frame 023998/0971 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 14, 2008
From: MOORE, MARK JUSTIN; KNIGHT, BRIAN JAMES
To: GLOBESPANVIRATA, INC.
Reel/Frame 021676/0994 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 1, 2007
From: GLOBESPANVIRATA, INC.
To: BROOKTREE BROADBAND HOLDING, INC.
Reel/Frame 018826/0939 →
SECURITY AGREEMENT Recorded Nov 21, 2006
From: BROOKTREE BROADBAND HOLDING, INC.
To: BANK OF NEW YORK TRUST COMPANY, N.A., THE
Reel/Frame 018573/0337 →