Preemptive and non-preemptive scheduling and execution of program threads in a multitasking operating system
First Claim
1. A computer system for scheduling execution of program threads of one or more application programs based on parameters specified by the application program(s) and executing the scheduled program threads, said system comprising:
- at least one processor;
first means, responsive to specifications by said application program(s) that one plurality of said program threads is assigned to one class and another plurality of said program threads is assigned to another class, for storing indications that said one plurality of program threads is assigned to said one class and said other plurality of program threads is assigned to said other class;
second means, responsive to specifications by said application program(s) of a priority level for each of said program threads, for storing an indication of the priority level of each of said program threads;
third means, responsive to specification by an application program or program thread that a program thread is unavailable for execution, for storing an indication that said program thread is unavailable for execution and responsive to a specification by an application program or another program thread that said program thread is available for execution, for storing an indication that said program thread is available for execution; and
means, coupled to the first, second and third storing means and said processor processors, for selecting the highest priority available program thread from each of said classes for execution by said processor or processors and scheduling said selected program threads for execution by said processor or processors in order of priority level such that the highest priority, selected program thread is executed first; and
wherein the selecting and scheduling means includesmeans for preempting execution of a program thread from either of said classes with a higher priority level program thread from the other class, said higher priority level program thread from said other class being made available or assigned to said other class after selection by the selecting means of another program thread from said other class with a lower priority than the executing program thread, said selecting means subsequently selecting said higher priority program thread from said other class in place of said lower priority program thread from said other class for execution by the processor; and
means for preventing a program thread in said one class, which was made available or assigned to said one class after selection by the selecting means of another, lower priority program thread from said one class for execution, from preempting execution of said other, lower priority selected program thread from said one class.
1 Assignment
0 Petitions
Accused Products
Abstract
A multitasking operating system permits application programs (and their developers) to influence a schedule of execution of program threads which constitute the application programs by specifying parameters for the program threads. The parameters indicate each thread'"'"'s priority level and dispatch class in which the thread resides. The application programs specify the thread'"'"'s parameters based on the following principles of the operating system. The operating system queues the highest priority thread available for execution from each dispatch class onto a run list for execution by a processor. The highest priority thread on the run list is executed first. While this thread is dispatchable and being executed, no other thread from the same dispatch class can preempt it unless this executing thread voluntarily relinquishes control of the processor, even if the other thread has a higher priority. (This other thread would have been created or made available after the currently executing thread was selected for the run list.) However, the currently executing thread can be involuntarily preempted at any time by another higher priority, available thread from a different dispatch class. A thread can also voluntarily relinquish control of its processor at other appropriate points in the execution, for example, when data structures are valid, to share the processor with other lower priority threads from the same or different dispatch classes.
-
Citations
12 Claims
-
1. A computer system for scheduling execution of program threads of one or more application programs based on parameters specified by the application program(s) and executing the scheduled program threads, said system comprising:
-
at least one processor; first means, responsive to specifications by said application program(s) that one plurality of said program threads is assigned to one class and another plurality of said program threads is assigned to another class, for storing indications that said one plurality of program threads is assigned to said one class and said other plurality of program threads is assigned to said other class; second means, responsive to specifications by said application program(s) of a priority level for each of said program threads, for storing an indication of the priority level of each of said program threads; third means, responsive to specification by an application program or program thread that a program thread is unavailable for execution, for storing an indication that said program thread is unavailable for execution and responsive to a specification by an application program or another program thread that said program thread is available for execution, for storing an indication that said program thread is available for execution; and means, coupled to the first, second and third storing means and said processor processors, for selecting the highest priority available program thread from each of said classes for execution by said processor or processors and scheduling said selected program threads for execution by said processor or processors in order of priority level such that the highest priority, selected program thread is executed first; and
wherein the selecting and scheduling means includesmeans for preempting execution of a program thread from either of said classes with a higher priority level program thread from the other class, said higher priority level program thread from said other class being made available or assigned to said other class after selection by the selecting means of another program thread from said other class with a lower priority than the executing program thread, said selecting means subsequently selecting said higher priority program thread from said other class in place of said lower priority program thread from said other class for execution by the processor; and means for preventing a program thread in said one class, which was made available or assigned to said one class after selection by the selecting means of another, lower priority program thread from said one class for execution, from preempting execution of said other, lower priority selected program thread from said one class. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method for scheduling execution of program threads of one or more application programs based on parameters specified by the application program(s) and executing the scheduled program threads on one or more computer processors, said method comprising the steps of:
-
receiving specifications by said application program(s) that one plurality of said program threads is assigned to one class and another plurality of said program threads is assigned to another class, and in response, storing indications that said one plurality of program threads is assigned to said one class and said other plurality of program threads is assigned to said other class; receiving specifications by said application program(s) of a priority level for each of said program threads, and in response, storing an indication of the priority level of each of said program threads; receiving specification by an application program or program thread that a program thread is unavailable for execution, and in response, storing an indication that said program thread is unavailable for execution and receiving a specification by an application program or another program thread that said program thread is available for execution, and in response, storing an indication that said program thread is available for execution; selecting the highest priority available program thread from each of said classes for execution by said processor or processors and scheduling said selected program threads for execution by said processor or processors in order of priority level such that the highest priority, selected program thread is executed first; preempting execution of a program thread from either of said classes with a higher priority level program thread from the other class, said higher priority level program thread from said other class being made available or assigned to said other class after selection by the selecting means of another program thread from said other class with a lower priority than the executing program thread; subsequent to said preempting step, selecting said higher priority program thread from said other class in place of said lower priority program thread from said other class for execution by the processor; and
preventing a program thread in said one class, which was made available or assigned to said one class after selection of another, lower priority program thread from said one class of execution, form preempting execution of said other, lower priority selected program thread from said one class. - View Dependent Claims (8, 9, 10, 11, 12)
-
Specification