Presentation is loading. Please wait.

Presentation is loading. Please wait.

1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.

Similar presentations


Presentation on theme: "1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x."— Presentation transcript:

1 1

2  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x 2

3  To explain the timing requirements of real-time systems  To distinguish between hard and soft real-time systems  To discuss the defining characteristics of real-time systems  To describe scheduling algorithms for hard real- time systems 3

4  A real-time system requires that results be produced within a specified deadline period  An embedded system is a computing device that is part of a larger system (I.e. automobile, airliner)  A safety-critical system is a real-time system with catastrophic results in case of failure 4

5  A hard real-time system guarantees that real-time tasks be completed within their required deadlines  A soft real-time system provides priority of real- time tasks over non real-time tasks 5

6  Single purpose  Small size  Inexpensively mass-produced  Specific timing requirements 6

7 7

8  Many real-time systems are designed using system-on-a-chip (SOC) strategy  SOC allows the CPU, memory, memory- management unit, and attached peripheral ports (I.e. USB) to be contained in a single integrated circuit. 8

9  Most real-time systems do not provide the features found in a standard desktop system  Reasons include: ◦ Real-time systems are typically single-purpose ◦ Real-time systems often do not require interfacing with a user ◦ Features found in a desktop PC require more substantial hardware that what is typically available in a real-time system ◦ Real-Time systems should be economically practical 9

10  Address translation may occur via: 1.Real-addressing mode where programs generate actual addresses 2. Relocation register mode 3.Implementing full virtual memory 10

11 11

12 12

13 13

14  In general, real-time operating systems must provide: 1. Preemptive, priority-based scheduling 2. Preemptive kernels 3. Latency must be minimized 14

15  Priority-based scheduling algorithms assign each process a priority based on its importance.  Most important tasks are assigned higher priority than those deemed less important.  By supporting preemption, a process currently running on the CPU will be preempted if a higher- priority process become available to run. 15

16 Two Strategies to make a kernel preemptive:  Insert preemption points in long-duration system calls.  Synchronization mechanisms Any kernel data being updated are protected from modification by higher-priority process 16

17 Event latency is the amount of time from when an event occurs to when it is serviced. 17

18 Two types of latencies affect the performance of real-time systems:  Interrupt latency  Dispatch latency 18

19 Interrupt latency is the period of time from when an interrupt arrives at the CPU to when it is serviced 19

20 Dispatch latency is the amount of time required for the scheduler to stop one process and start another 20

21  Issue: A higher-priority process needs to read or modify kernel data that are currently used by lower-priority process. ◦ Kernel data are typically protected with a lock.  Example: we have 3 process, L, M and H. ◦ Their priorities follow the order L < M < H. ◦ Process H requires resource R, which is currently being used by L. ◦ H has to wait for L to finish using resource R. ◦ M become runnable and preempting process L. 21

22 All process that are accessing the resources needed by higher-priority process inherits the higher priority until they are finished with the resources.  Example: ◦ Priority-Inheritance protocol allows L to temporarily inherit the priority of process H. ◦ M can’t preemption the execution of L. ◦ When L finishes using resource R, its priority set to the original one. ◦ Resource R is available, process H not M will run next. 22

23  Periodic processes require the CPU at specified intervals (periods)  p is the duration of the period  d is the deadline by when the process must be serviced  t is the processing time 23

24 24 Assume 2 process, and. The periods are: = 50 and = 100. The processing times are: = 20 and = 35 The deadline for each process requires that it complete its CPU burst by the start of its next period.

25  A priority is assigned based on the inverse of its period  Shorter periods = higher priority;  Longer periods = lower priority  P1is assigned a higher priority than P2. 25

26 26 Assume 2 process, and. The periods are: = 50 and = 80. The processing times are: = 25 and = 35

27  Priorities are assigned according to deadlines: 1.the earlier the deadline, the higher the priority 2.the later the deadline, the lower the priority 27

28  T shares are allocated among all processes in the system  An application receives N shares where N < T  This ensures each application will receive N / T of the total processor time 28

29 Example:  Assume that a total of T = 100 shares is to be divided among three processes A, B and C.  A is assigned 50 shares, B is assigned 15 shares and C is assigned 20 shares. Admission control policy guarantees that an application receives its allocated shares of time. 29

30  The Pthread API provides functions for managing real-time threads  Pthreads defines two scheduling classes for real-time threads: 1. SCHED_FIFO -threads are scheduled using a FCFS strategy with a FIFO queue. There is no time- slicing for threads of equal priority 2. SCHED_RR -similar to SCHED_FIFO except time- slicing occurs for threads of equal priority 30

31 31

32  The Wind microkernel provides support for the following: 1.Processes and threads 2.preemptive and non-preemptive round-robin scheduling 3. manages interrupts (with bounded interrupt and dispatch latency times) 4.shared memory and message passing inter process communication facilities 32

33 33


Download ppt "1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x."

Similar presentations


Ads by Google