Presentation is loading. Please wait.

Presentation is loading. Please wait.

Page 1 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Chapter 15 Specification of Software Components.

Similar presentations


Presentation on theme: "Page 1 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Chapter 15 Specification of Software Components."— Presentation transcript:

1 Page 1 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Chapter 15 Specification of Software Components

2 Page 2 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Overview qIntroduction qWindows NT as a real-time OS qReal-time features of windows NT qObservations and recommendations qWindows NT in a real-time setting q Summary

3 Page 3 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Introduction q Windows NT is presented from the perspective of real- time constraints. q Address the following questions: l What type of applications can use Windows NT, as is? l Can the unpredictable parts of NT be “masked”?

4 Page 4 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Windows NT as a Real-Time OS q The original design of NT was based on a micro-kernel, common to many real-time operating systems. q During the evolution a limited number of real-time features have been incorporated: l IDLE, NORMAL, HIGH and REALTIME. l The REALTIME priority class is available as a support for real-time applications. l The base priority for the REALTIME class includes levels 16 to 31. Levels 17 to 21 and 27 to 30 are currently not used by the scheduler.

5 Page 5 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Windows NT Priority Structure Interrupts Deferred Procedure Calls (DPC) Time Critical NA Highest Above Normal Normal Below Normal Lowest NA Idle 31 26 25 24 23 22 16 15 0 Time Critical Normal Foreground Normal Background Below Normal Idle Idle Thread Real-Time Priority Class Dynamic-Time Priority Classes Decreasing Priority

6 Page 6 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Scheduling q Priority based preemptive scheduling: l The highest priority active task is chosen for execution possibly interrupting the execution of another task. q Base priority q REALTIME: non-degradable priorities q NORMAL/HIGH can be delayed l For this reason the latter priority classes are commonly referred to as dynamic classes.

7 Page 7 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Deferred Procedure Call q Interrupt service routine (ISR) q Deferred procedure call (DPC) l DPCs are queued in the system DPC queue, in a first in first out (FIFO) manner. q Separation of ISR and DPC l Allows quick response to any further interrupts, l The priority structure at the interrupt level is not maintained in the DPC queues. q A DPC is not preemptable by another DPC, q A DPC be preempted by an (unimportant) interrupt.

8 Page 8 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Real-Time Features of Windows NT qEmpirical Characterization of NT’s Features which affect Real-Time Activities l The first set of experiments was targeted toward the behavior of threads at REALTIME priority class and their effect on the I/O Subsystem, and visa versa. l To this end, we used two threads with the same thread priority in the REALTIME class, one performing I/O and another, a CPU-intensive thread, performing a continuous “for loop”.

9 Page 9 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Experiment 1 q To study the effect on keyboard and mouse I/O, the I/O thread was made to read from the keyboard/mouse. l When the CPU-intensive thread was running, no I/O activity was observed. l After the CPU-intensive thread completed, all the keyboard inputs were processed. l This showed that the CPU-intensive real-time thread essentially shuts out keyboard/mouse I/O even when this I/O is from/to a real-time thread.

10 Page 10 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Experiment 2 q To study the effect on disk I/O, the I/O thread was made to write a file with 40,000 64-bit values. l The time-stamps for the I/O and CPU-intensive activities were found to be interleaved, this indicating time-sharing between the two threads. l This showed that a CPU-intensive real-time thread did not shut out disk I/O.

11 Page 11 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Experiment 3 q To study the effect on network I/O, the I/O thread was made to read data from a remote server using Windows Sockets API. l The time-stamps for the two activities were found to be interleaved, this indicating time-sharing between the two threads. l This showed that a CPU-intensive real-time thread has no adverse impact on network I/O.

12 Page 12 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Explaining the Observations q The I/O manager sends the request in the form of an I/O request packet (IRP) to the device driver. The driver starts the I/O operation. q The device completes the I/O operation and interrupts. The device driver then services the interrupt. (This involves execution of ISR and queuing of a DPC.) q The I/O manager completes the I/O request.

13 Page 13 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Time Taken for System Operations Win32API Function NameTime (  secs) CreateProcess() 2600 SetPriorityClass() - from normal to real-time priority class 240 SetPriorityClass() - for all others combinations 125 SetThreadPriority() - for a thread to set its own priority 9 SetThreadPriority() - for a thread to set priority of another thread of the same process 10 QueryPerformanceCounter() - to obtain the current time-stamp 6

14 Page 14 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Observations and Recommendations qPotential blocking time q If processes or threads are performing network or disk I/O, the effect of system-wide FIFO DPC queues may lead to unbounded response times. qIf the duration of I/O activity in a given period can be characterized, it may be possible to compute the response times conservatively. qOne should not depend on the Windows NT scheduler to achieve correct “fair sharing” behavior in cases where screen, keyboard and mouse interactions are at the same level of priority as the other real-time CPU- intensive tasks.

15 Page 15 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Windows NT in a Real-Time Setting q Operator input q Incoming sensor data q Incoming video streams

16 Page 16 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Design of the Real-Time Application  Efficiency through threads  Achieving periodicity Heart beat is a highest prio process  Periodically enables user-level threads  User-level threads can execute for 1 time unit only

17 Page 17 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Software Architecture of Industrial Control Prototype Producer ReceiverConsumerBuffer Heartbeat Ti Acknowledgement Operator input Operator ack Real Video

18 Page 18 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Software Architecture of Industrial Control Prototype  Besides the Heartbeat timer at each node, the main entities at the remote server are: Producer Acknowledgment  The main entities at the operator workstation are: Receiver Consumer Operator input Operator ack

19 Page 19 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Summary q Using HIGH or REAL_TIME priority alone significantly reduces the variability in response times, without any observable degradation in system performance, so: l IF the application tasks do not monopolize the CPU for long durations, l AND there is sufficient CPU capacity, l THEN using these priority assignments may be sufficient to meet the performance requirements of these processes – even when I/O is involved.

20 Page 20 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Summary Continued q However: l IF the periodic workload per process is high, or l IF a process is a COTS application whose workload varies, l THEN it will be necessary to impose some additional controls on the amount of time allocated to a task. Our findings indicate that a scheduling approach combined with an admission


Download ppt "Page 1 Building Reliable Component-based Systems Chapter 15 - Specification of Software Components Chapter 15 Specification of Software Components."

Similar presentations


Ads by Google