Skip to document

Process management

Process management
Course

Software Engineering (CSPC 111)

140 Documents
Students shared 140 documents in this course
Academic year: 2022/2023
Uploaded by:
Anonymous Student
This document has been uploaded by a student, just like you, who decided to remain anonymous.
Don Mariano Marcos Memorial State University

Comments

Please sign in or register to post comments.

Preview text

Process management

Real-time systems have to handle external events quickly and, in some cases, meet deadlines for processing these events. The event-handling processes must therefore be scheduled for execution in time to detect the event. They must also be allocated sufficient processor resources to meet their deadline. The process manager in an RTOS is responsible for choosing processes for execution, allocating processor and memory resources, and starting and stopping process execution on a processor.

The process manager has to manage processes with different priorities. For some stimuli, such as those associated with certain exceptional events, it is essential that their processing should be completed within the specified time limits. Other processes may be safely delayed if a more critical process requires service. Consequently, the RTOS has to be able to manage at least two priority levels for system processes:

  1. Clock level  This level of priority is allocated to periodic processes.

  2. Interrupt level  This is the highest priority level. It is allocated to processes that need a very fast response. One of these processes will be the real-time clock process. This process is not required if interrupts are not supported in the system.

A further priority level may be allocated to background processes (such as a self- checking process) that do not need to meet real-time deadlines. These processes are scheduled for execution when processor capacity is available.

Periodic processes must be executed at specified time intervals for data acquisition and actuator control. In most real-time systems, there will be several types of periodic process. Using the timing requirements specified in the application program, the RTOS arranges the execution of periodic processes so that they can all meet their deadlines.

The actions taken by the operating system for periodic process management are shown in Figure 21. The scheduler examines the list of periodic processes and selects a process to be executed. The choice depends on the process priority, the process periods, the expected execution times, and the deadlines of the ready processes. Sometimes two processes with different deadlines should be executed at the same clock tick. In such a situation, one process must be delayed. Normally, the system will choose to delay the process with the longest deadline.

Processes that have to respond quickly to asynchronous events may be interrupt- driven. The computer’s interrupt mechanism causes control to transfer to a predetermined memory location. This location contains an instruction to jump to a simple and fast interrupt service routine. The service routine disables further interrupts to avoid being interrupted itself. It then discovers the cause of the interrupt and initiates, with a high priority, a process to handle the stimulus causing the interrupt. In some high- speed data acquisition systems, the interrupt handler saves the data that the interrupt signaled was available in a buffer for later processing. Interrupts are then enabled again, and control is returned to the operating system.

At any one time several processes, all with different priorities, could be executed. The process scheduler implements system-scheduling policies that determine the order of process execution. There are two commonly used scheduling strategies:

  1. Non preemptive scheduling  After a process has been scheduled for execution, it runs to completion or until it is blocked for some reason, such as waiting for input. This can cause problems if there are processes with different priorities and a high- priority process has to wait for a low-priority process to finish.

■ Real-time systems are usually implemented as a set of communicating processes that react to stimuli to produce responses.

■ State models are an important design representation for embedded real-time systems. They are used to show how the system reacts to its environment as events trigger changes of state in the system.

■ Several standard patterns can be observed in different types of embedded system. These include a pattern for monitoring the system’s environment for adverse events, a pattern foractuator control, and a data-processing pattern.

■ Designers of real-time systems have to do a timing analysis, which is driven by the deadlines for processing and responding to stimuli. They have to decide how often each process in the spatter should run and the expected and worst-case execution time for processes.

■ A real-time operating system is responsible for process and resource management. It always includes a scheduler, which is the component responsible for deciding which process should be scheduled for execution.

Was this document helpful?

Process management

Course: Software Engineering (CSPC 111)

140 Documents
Students shared 140 documents in this course
Was this document helpful?
Process management
Real-time systems have to handle external events quickly and, in some cases, meet
deadlines for processing these events. The event-handling processes must therefore be
scheduled for execution in time to detect the event. They must also be allocated
sufficient processor resources to meet their deadline. The process manager in an RTOS
is responsible for choosing processes for execution, allocating processor and memory
resources, and starting and stopping process execution on a processor.
The process manager has to manage processes with different priorities. For some
stimuli, such as those associated with certain exceptional events, it is essential that their
processing should be completed within the specified time limits. Other processes may
be safely delayed if a more critical process requires service. Consequently, the RTOS
has to be able to manage at least two priority levels for system processes:
1. Clock level
This level of priority is allocated to periodic processes.
2. Interrupt level
This is the highest priority level. It is allocated to processes that need a
very fast response. One of these processes will be the real-time clock
process. This process is not required if interrupts are not supported in the
system.
A further priority level may be allocated to background processes (such as a self-
checking process) that do not need to meet real-time deadlines. These processes are
scheduled for execution when processor capacity is available.