[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

EP1514181A2 - Task dispatch in priority pre-emptive real-time operating systems - Google Patents

Task dispatch in priority pre-emptive real-time operating systems

Info

Publication number
EP1514181A2
EP1514181A2 EP03718943A EP03718943A EP1514181A2 EP 1514181 A2 EP1514181 A2 EP 1514181A2 EP 03718943 A EP03718943 A EP 03718943A EP 03718943 A EP03718943 A EP 03718943A EP 1514181 A2 EP1514181 A2 EP 1514181A2
Authority
EP
European Patent Office
Prior art keywords
task
context
function
class
attributes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
EP03718943A
Other languages
German (de)
French (fr)
Inventor
David K. Lake, Jr.
Nicholas Merriam
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Livedevices Ltd
Original Assignee
Livedevices Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from GB0209800A external-priority patent/GB2388213A/en
Application filed by Livedevices Ltd filed Critical Livedevices Ltd
Publication of EP1514181A2 publication Critical patent/EP1514181A2/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/461Saving or restoring of program or task context
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Definitions

  • the present invention relates to optimisation or at least improvement (in time and space domains) of task dispatch in priority pre-emptive real-time operating systems that consist of a plurality of different types of tasks.
  • Embodiments of the present invention are of particular relevance to the technical field of embedded devices and the control thereof, since these generally use static priority-based scheduling given the limited range of functions required.
  • Each task is described to the configuration tool including its name, priority and entry function. From this the configuration tool constructs a set of data structures for each task that include the priority and the entry function.
  • the function inside the operating system kernel that manages task switching is called the dispatcher. This is responsible for saving any necessary context, invoking the entry function of the task that is to be activated, and then restoring the previous context when the task terminates.
  • Applications built using such operating systems typically consist of a plurality of concurrent tasks.
  • the present invention relates to minimising, or at least reducing, the amount of context that needs to be saved when making a context switch between any two tasks.
  • a generic dispatcher function will tend to be large and slow, since it needs to be able to deal with any type of task and may need to save and load any number of contexts or resources.
  • a method of improving operating system efficiency in which tasks managed by the operating system are organised into a plurality of classes, each class being defined by predetermined task attributes, and wherein a separate dispatcher function is generated for each class.
  • a computing device having an operating system, wherein tasks managed by the operating system are organised into a plurality of classes, each class being defined by predetermined combinations of task attributes, and wherein there is provided a separate dispatcher function for each class.
  • an operating system for a computing device managing a plurality of tasks each having various attributes, the tasks being organised into a plurality of classes each defined by a unique combination of task attributes, wherein a separate dispatcher function is provided for each class.
  • a configuration tool for use with an operating system managing a plurality of tasks each having various attributes, wherein the configuration tool is operable to organise the tasks into a plurality of classes each defined by a unique combination of task attributes.
  • the tasks are organised into the various classes off-line.
  • each dispatcher function may be streamlined to the particular attributes for improved efficiency, rather than the operating system relying on a generic dispatcher function that needs to be able to deal actively with any task having any particular set of attributes.
  • each task will have an associated data structure that describes the task and its attributes.
  • the data structure advantageously contains a reference not only to the entry function of the task (as is usual in existing operating systems), but also to the dispatcher function dedicated to that class of task. This enables each task to be directed to the dispatcher function appropriate to its class.
  • a relatively small generic "main" or "head” dispatcher function which can individually call any of a plurality of "sub" dispatcher functions, each dedicated to dispatching tasks having a unique predetermined set of attributes.
  • prior art systems such as disclosed in US 5,799,188 do not provide any off-line analysis, do not use (statically configured) subdispatcher functions and do not optimise based on static properties. Instead, such systems make a (dynamic) conditional choice based on flags, and make no use of off-line tools to statically determine appropriate run-time behaviour.
  • a "Class C” task that only needs to save and restore floating point context, and does not need to create a jump_buf structure because the task always terminates at the end of its entry function, might have the subdispatcher function:
  • OS_Save_FP_Context () ; OS_Set_Interrupt_Priority (t) ; OS_Task_To_Dispatch->entry () ; OS_Set_Interrupt_Priority (KERNEL) ; OS Restore FP Context ( ) ;
  • OS_Save_DSP_Context () ; 10 OS_Save_FP_Context () ;
  • OS_Set_Interrupt_Priority(KERNEL) OS_Restore_DSP_Context () ; OS Restore FP Context ();
  • typedef struct ⁇ void (*dispatcher) (void) ; 30. void (*entry) (void) ; int priority; ⁇ Task_control_block;
  • a further optimisation, or at least improvement, of this mechanism can be made such that if a task needs no extra context to be loaded or saved, the dispatcher function dedicated to the class of that task can be optimised to be its own entry function.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

A method, computing device, operating system and configuration tool for optimising or at least improving task dispatch in a priority pre-emptive real-time context are disclosed. Tasks making up an operating system are categorised into various classes in accordance with various task attributes, such as need to save floating point context, need to save digital signal processor context and the like. Each class contains only tasks having a unique combination of attributes. An individual subdispatcher function is then generated for each class, the subdispatcher function being adapted to handle tasks within that class with high efficiency. In this way, unnecessary saving and loading of contexts is reduced, and operating efficiency is improved.

Description

IMPROVEMENTS RELATING TO TASK DISPATCH IN PRIORITY PREEMPTIVE REAL-TIME OPERATING SYSTEMS
The present invention relates to optimisation or at least improvement (in time and space domains) of task dispatch in priority pre-emptive real-time operating systems that consist of a plurality of different types of tasks. Embodiments of the present invention are of particular relevance to the technical field of embedded devices and the control thereof, since these generally use static priority-based scheduling given the limited range of functions required.
In an operating system that is based around static priority based task scheduling (systems in which the priority ordering of the tasks is determined offline and remains constant), there exists some external description of the tasking structure of the system that is used to generate data structures describing the tasks and their priorities. This description is most advantageously calculated offline by a "configuration tool" or other program and used to initialise the system when it starts up. Tasks in such an operating system may be activated at any time, but do riot start to run until they are the highest-priority runnable task in the system. They continue to run (though they may be pre-empted by other higher-priority tasks at which point a context switch takes place) until their work is done and then terminate. Each task has an entry function that embodies the work the task will carry out.
Each task is described to the configuration tool including its name, priority and entry function. From this the configuration tool constructs a set of data structures for each task that include the priority and the entry function.
The function inside the operating system kernel that manages task switching is called the dispatcher. This is responsible for saving any necessary context, invoking the entry function of the task that is to be activated, and then restoring the previous context when the task terminates. Applications built using such operating systems typically consist of a plurality of concurrent tasks. The present invention relates to minimising, or at least reducing, the amount of context that needs to be saved when making a context switch between any two tasks.
Let us consider a conventional operating system that treats all tasks identically when dispatching. It must save any context that may be changed in the task to be dispatched (since it cannot determine what the task itself will be using) and must subsequently restore the context, h a hypothetical operating system, the dispatcher function might look like this :
/* Called with interrupts locked out */ void OS_Dispatch(void)
{ task *t = OS_Find_Highest_Priority_Runnable_Task() ; if (t != OS_Currently_Running_Task () ) { OS_Save_All_Context () ; set__interrupt_priority (t) ; /* drop down to task T's IP */ if (setjmp (jmp_buf) ==0) { t->entry(); /* Call the task's entry function */
} set_interrupt_priority (KERNEL) ;
OS Restore All Context ();
} }
Consider what "OS_Save_AU_Context" and other dispatcher actions may need to save. A task could:
- need space to preserve floating point (fp), Digital Signal Processor (dsp), Memory Management Unit (mmu) or other device context
- need space to preserve stack context to allow fast task termination from a function called from its entry point (for example, using a jump buf structure and setjmp/longjmp calls in C)
- need space to store other task-specific data h other words, a generic dispatcher function will tend to be large and slow, since it needs to be able to deal with any type of task and may need to save and load any number of contexts or resources.
However, it is highly likely that not all tasks will require all the context to be loaded or saved (it can be shown that only when a higher-priority task pre-empts another task that shares access to a particular resource or piece of context must that resource or context be saved in order to preserve the illusion that every task has unrestricted access to all resources).
It is known, for example from US 5,799,188, to provide a multithreaded operating system in which the efficiency of thread context switching is improved by defining a plurality of thread classes and then only saving and restoring the information upon thread context switching that is required for the particular class of thread. However, this system makes a dynamic choice, based on flags, at each context switch, which can be time consuming and computationally expensive.
According to a first aspect of the present invention, there is provided a method of improving operating system efficiency, in which tasks managed by the operating system are organised into a plurality of classes, each class being defined by predetermined task attributes, and wherein a separate dispatcher function is generated for each class.
According to a second aspect of the present invention, there is provided a computing device having an operating system, wherein tasks managed by the operating system are organised into a plurality of classes, each class being defined by predetermined combinations of task attributes, and wherein there is provided a separate dispatcher function for each class.
According to a third aspect of the present invention, there is provided an operating system for a computing device, the operating system managing a plurality of tasks each having various attributes, the tasks being organised into a plurality of classes each defined by a unique combination of task attributes, wherein a separate dispatcher function is provided for each class.
According to a fourth aspect of the present invention, there is provided a configuration tool for use with an operating system managing a plurality of tasks each having various attributes, wherein the configuration tool is operable to organise the tasks into a plurality of classes each defined by a unique combination of task attributes.
Preferably, the tasks are organised into the various classes off-line.
By organising the tasks of the operating system into different classes, each class being uniquely defined by a particular combination of task attributes, it is possible to build up a library of dispatcher functions adapted to the needs of different types of tasks. Accordingly, each dispatcher function may be streamlined to the particular attributes for improved efficiency, rather than the operating system relying on a generic dispatcher function that needs to be able to deal actively with any task having any particular set of attributes.
Generally, each task will have an associated data structure that describes the task and its attributes. The data structure advantageously contains a reference not only to the entry function of the task (as is usual in existing operating systems), but also to the dispatcher function dedicated to that class of task. This enables each task to be directed to the dispatcher function appropriate to its class.
In some embodiments, there may be provided a relatively small generic "main" or "head" dispatcher function which can individually call any of a plurality of "sub" dispatcher functions, each dedicated to dispatching tasks having a unique predetermined set of attributes. In contrast to embodiments of the present invention, prior art systems such as disclosed in US 5,799,188 do not provide any off-line analysis, do not use (statically configured) subdispatcher functions and do not optimise based on static properties. Instead, such systems make a (dynamic) conditional choice based on flags, and make no use of off-line tools to statically determine appropriate run-time behaviour.
Let us consider an example in a system that permits eight classes of task:
For each of these classes of task, there will be a separate "sub" dispatcher function. All of these are assumed to operate on a global variable containing a pointer to the task to dispatch.
For example, a "Class C" task that only needs to save and restore floating point context, and does not need to create a jump_buf structure because the task always terminates at the end of its entry function, might have the subdispatcher function:
void Class_C__Dispatch (void) {
OS_Save_FP_Context () ; OS_Set_Interrupt_Priority (t) ; OS_Task_To_Dispatch->entry () ; OS_Set_Interrupt_Priority (KERNEL) ; OS Restore FP Context ( ) ;
h contrast, a "Class H" task that needs to save and load floating point and DSP 5 context and create a jump_buf structure might have the subdispatcher function:
void Class_H_Dispatch (void)
{
OS_Save_DSP_Context () ; 10 OS_Save_FP_Context () ;
OS_Set_Interrupt_Priority (t) ; if (setjrap (jmp_buf) ==0) {
OS_Task_To_Dispatch->entry() ;
} 15 OS_Set_Interrupt_Priority(KERNEL) ; OS_Restore_DSP_Context () ; OS Restore FP Context ();
20
Let us assume that for each task the operating system configuration tool parses a description such as:
TASK tl CLASS c ENTRY tl_entry PRIORITY 1 ;
25
It must therefore output a structure that consists of (at least) the following fields:
typedef struct { void (*dispatcher) (void) ; 30. void (*entry) (void) ; int priority; } Task_control_block;
As an aside, it is to be noted that C syntax is being used for the purposes of
35 illustration. It will, however, be apparent to the skilled reader that it is possible to generate structures in assembly language that can be used interchangeably with those in high-level languages, so the data structure can be generated in any form that has equivalent effect to that described above.
In an operating system adapted to use such a subdispatch mechanism the "main" or "head" dispatcher is modified to call the appropriate subdispatcher for each particular class of task:
/* This is only called from the kernel - so safe to make it static */ static task *OS_task_to_dispatch
void OS_Dispatch(void)
{ task *t = OS_Find_Highest_Priority_Runnable_Task() ; if (t != OS_Currently_Running_Task () ) { OS_task_to_dispatch = t;
OS_task_to_dispatch->dispatche () ; /* Call the task's dispatcher function */
} }
A further optimisation, or at least improvement, of this mechanism can be made such that if a task needs no extra context to be loaded or saved, the dispatcher function dedicated to the class of that task can be optimised to be its own entry function.
In the context of the above exposition, this means that "Class A" tasks have their dispatcher function set to be their own entry function - it is possible for the configuration tool to determine statically that some tasks need no extra context and for it to modify the data structures generated for tasks such that they point the "dispatcher" member directly to the entry function.
The preferred features of the invention are applicable to all aspects of the invention and may be used in any possible combination. Throughout the description and claims of this specification, the words "comprise" and "contain" and variations of the words, for example "comprising" and "comprises", mean "including but not limited to", and are not intended to (and do not) exclude other components, integers, moieties, additives or steps.

Claims

CLAIMS:
1. A method of improving operating system efficiency, in which tasks managed by the operating system are organised into a plurality of classes, each class being defined by predetermined task attributes, and wherein a separate dispatcher function is generated for each class.
2. A method according to claim 1, wherein a main dispatcher function calls the separate dispatcher functions as required.
3. A method according to claim 1 or 2, wherein the attributes are selected from a non-exhaustive group including: need to save floating point context, need to save digital signal processor context and need to save memory management unit context.
4. A method according to any preceding claim, wherein the tasks are organised into classes off-line by a configuration tool.
5. A method according to any preceding claim, wherein each task has an associated data structure that describes the task and its attributes, and wherein the data structure includes a reference to the dispatcher function appropriate to the class of the task.
6. A method according to any preceding claim, wherein each task has an entry function that performs work that the task is to carry out, and wherein, if it is determined that a task requires no extra context to be loaded or saved, the dispatcher function for the class of that task is used as the entry function for that task.
7. A computing device having an operating system, wherein tasks managed by the operating system are organised into a plurality of classes, each class being defined by predetermined combinations of task attributes, and wherein there is provided a separate dispatcher function for each class.
8. A device as claimed in claim 7, wherein a main dispatcher function is provided, the main dispatcher function being adapted to call the separate dispatcher functions as required.
9. A device as claimed in claim 7 or 8, wherein the attributes are selected from a non-exhaustive group including: need to save floating point context, need to save digital signal processor context and need to save memory management unit context.
10. A device as claimed in any one of claims 7 to 9, further comprising a configuration tool adapted to organise the tasks into classes off-line.
11. A device as claimed in any one of claims 7 to 10, wherein each task has an associated data structure that describes the task and its attributes, and wherein the data structure includes a reference to the dispatcher function appropriate to the class of the task.
12. A device as claimed in any one of claims 7 to 11, wherein each task has an entry function that performs work that the task is to carry out, and wherein, if it is determined that a task requires no extra context to be loaded or saved, the dispatcher function for the class of that task is used as the entry function for that task.
13. An operating system for a computing device, the operating system managing a plurality of tasks each having various attributes, the tasks being organised into a plurality of classes each defined by a unique combination of task attributes, wherein a separate dispatcher function is provided for each class.
14. An operating system as claimed in claim 13, wherein a main dispatcher function is provided, the main dispatcher function being adapted to call the separate dispatcher functions as required.
15. An operating system as claimed in claim 13 or 14, wherein the attributes are selected from a non-exhaustive group including: need to save floating point context, need to save digital signal processor context and need to save memory management unit context.
16. An operating system as claimed in any one of claims 13 to 15, further comprising a configuration tool adapted to organise the tasks into classes off-line.
17. An operating system as claimed in any one of claims 13 to 16, wherein each task has an associated data structure that describes the task and its attributes, and wherein the data structure includes a reference to the dispatcher function appropriate to the class of the task.
18. An operating system as claimed in any one of claims 13 to 17, wherein each task has an entry function that performs work that the task is to carry out, and wherein, if it is determined that a task requires no extra context to be loaded or saved, the dispatcher function for the class of that task is used, as the entry function for that task.
19. A configuration tool for use with an operating system managing a plurality of tasks each having various attributes, wherein the configuration tool is operable to organise the tasks into a plurality of classes each defined by a unique combination of task attributes.
20. A tool as claimed in claim 19, wherein the attributes are selected from a non- exhaustive group including: need to save floating point context, need to save digital signal processor context and need to save memory management unit context.
21. A tool as claimed in claim 19 or 20, the tool being adapted to organise the tasks into classes off-line.
EP03718943A 2002-04-30 2003-04-16 Task dispatch in priority pre-emptive real-time operating systems Withdrawn EP1514181A2 (en)

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
GB0209800 2002-04-30
GB0209800A GB2388213A (en) 2002-04-30 2002-04-30 Improvements relating to task dispatch in priority pre-emptive real-time operating systems
US10/146,239 US20030204639A1 (en) 2002-04-30 2002-05-14 Task dispatch in priority pre-emptive real-time operating systems
US146239 2002-05-14
PCT/GB2003/001686 WO2003093995A2 (en) 2002-04-30 2003-04-16 Dispatch in priority pre-emptive real-time operating systems

Publications (1)

Publication Number Publication Date
EP1514181A2 true EP1514181A2 (en) 2005-03-16

Family

ID=29404289

Family Applications (1)

Application Number Title Priority Date Filing Date
EP03718943A Withdrawn EP1514181A2 (en) 2002-04-30 2003-04-16 Task dispatch in priority pre-emptive real-time operating systems

Country Status (3)

Country Link
EP (1) EP1514181A2 (en)
AU (1) AU2003222977A1 (en)
WO (1) WO2003093995A2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5630128A (en) * 1991-08-09 1997-05-13 International Business Machines Corporation Controlled scheduling of program threads in a multitasking operating system
JPH05127926A (en) * 1991-10-31 1993-05-25 Nec Corp Task controller
FR2696259A1 (en) * 1992-09-30 1994-04-01 Apple Computer Organisation of tasks and modules for execution in processor - uses context switching between tasks that are made up of modules linked to their resources and to following tasks
CA2131406C (en) * 1993-09-21 2002-11-12 David D'souza Preemptive multi-tasking with cooperative groups of tasks
US5799188A (en) * 1995-12-15 1998-08-25 International Business Machines Corporation System and method for managing variable weight thread contexts in a multithreaded computer system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See references of WO03093995A3 *

Also Published As

Publication number Publication date
WO2003093995A3 (en) 2004-12-29
AU2003222977A8 (en) 2003-11-17
AU2003222977A1 (en) 2003-11-17
WO2003093995A2 (en) 2003-11-13

Similar Documents

Publication Publication Date Title
US8612986B2 (en) Computer program product for scheduling ready threads in a multiprocessor computer based on an interrupt mask flag value associated with a thread and a current processor priority register value
US8166483B2 (en) Method and apparatus for implementing priority management of computer operations
US8161453B2 (en) Method and apparatus for implementing task management of computer operations
EP2312441B1 (en) Scheduling of instructions groups for cell processors
US20040055003A1 (en) Uniprocessor operating system design facilitating fast context swtiching
Dellinger et al. ChronOS Linux: a best-effort real-time multiprocessor Linux kernel
US5526521A (en) Method and system for process scheduling from within a current context and switching contexts only when the next scheduled context is different
JPH11353196A (en) Governor for time-scheduled process management
Zuberi et al. EMERALDS: a small-memory real-time microkernel
EP0955581A1 (en) Software interrupt mechanism
Straumann Open source real time operating systems overview
US9122521B2 (en) Enabling multiple operating systems to run concurrently using barrier task priority
US20070101326A1 (en) Dynamic change of thread contention scope assignment
US20030204639A1 (en) Task dispatch in priority pre-emptive real-time operating systems
Burns et al. Restricted tasking models
Golub Operating System Support for Coexistence of Real-Time and Conventional Scheduling.
Zuberi et al. EMERALDS: a small-memory real-time microkernel
Pulido et al. Hierarchical scheduling with Ada 2005
EP1514181A2 (en) Task dispatch in priority pre-emptive real-time operating systems
Humphrey et al. Kernel-level threads for dynamic, hard real-time environments
Mumolo et al. A hard real-time kernel for motorola microcontrollers
Locke et al. Java technology comes to real-time applications
Cherepov et al. Hard Real-time with {RTX} on Windows {NT}
Rivas et al. Early experience with an implementation of the POSIX. 13 minimal real-time operating system for embedded applications
Baskiyar A survey on real-time operating systems

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

17P Request for examination filed

Effective date: 20041020

AK Designated contracting states

Kind code of ref document: A2

Designated state(s): AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LI LU MC NL PT RO SE SI SK TR

AX Request for extension of the european patent

Extension state: AL LT LV MK

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION IS DEEMED TO BE WITHDRAWN

18D Application deemed to be withdrawn

Effective date: 20071102