Home | | Embedded Systems Design | Tasks, threads and processes

Chapter: Embedded Systems Design : Real-time operating systems

Tasks, threads and processes

This section discusses the nomenclature given to the software modules running within the RTOS environ-ment.

Tasks, threads and processes

 

This section discusses the nomenclature given to the software modules running within the RTOS environment. Typically, they have been referred to as tasks but other names such as threads and processes are also used to refer to entities within the RTOS. They are sometimes used instead as an interchangeable replacement for the term task. In practice, they refer to different aspects within the system.

 

So far in this , a task has been used to describe an entity of work within an operating system that has control over resources. When a context switch is performed, it effectively switches to another task which takes over. Strictly speaking the context switch may include additional information that is relevant to the task such as memory management information, which is beyond the simple register swapping that is performed within the processor. As a result, the term process is often used to encompass more than a simple context switch and thus includes the addi-tional information. The problem is that this is very similar to that of a task switch or context switch that the definitions have become blurred and almost interchangeable. A task or process has several characteristics:

 

                                                                         It owns or controls resources, e.g. access to peripherals and so on.

 

                                                                         It has threads of execution. These are paths through the code contained within the task or process. Normally, there is a single thread though but this may not always be the case. Multiple threads can be supported if the task or process can maintain separate data areas for each thread. This also requires the code to be written in a re-entrant manner.

 

It requires additional information beyond the normal reg-ister contents to maintain its integrity, e.g. memory man-agement information, cache flushing and so on. When a new process or task is swapped-in, not only are the proces-sor registers changed but additional work must be done such as invalidating caches to ensure that the new process or task does not access incorrect information.

 

A thread has different characteristics:

 

                                                                        It has no additional context information beyond that stored in the processor register set.

 

                                                                        Its ownership of resources is inherited from its parent task or process.

 

With a simple operating system, there is no difference between the thread context switch and the process level switch. As a result, these terms almost become interchangeable. With a multi-user, multitasking operating system, this is not the case. The process or task is the higher level with the thread(s) the lower level.

 

Some operating systems take this a stage further and define a three level hierarchy: a process consists of a set of tasks with each task having multiple threads. Be warned! These terms mean many different things depending on who is using them.

 

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Embedded Systems Design : Real-time operating systems : Tasks, threads and processes |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.