Quiz 1 Flashcards
(40 cards)
There are two types of real-time systems, what are they?
Hard real-time systems and soft real-time systems
What is the difference between hard and soft real-time systems
Hard real-time systems are strictly adherent to deadlines, where timing is absolutely vital.
Soft real-time systems are more forgiving, where occasional timing breaches do not cause critical failure.
The primary difference between the two is based on their tolerance for timing constraints.
To coordinate the process of sharing the CPU between multiple tasks, RTOS uses a program called a ________________
Kernel
What four things is an RTOS responsible for?
- Task management (scheduling/dispatching)
- Communication between tasks
- Input and output management
- Memory management
True or False: An RTOS can run tasks in parallel
False, an RTOS can switch between tasks (run concurrently) but they cannot be run in parallel
True or False: Tasks executions are asynchronous to each other
True
What is an event?
An event is defined as a change in the signals (hardware) or in the variables (software)
What are the two types of events that could occur?
Periodic: An event with a deterministic period
Sporadic: Non-periodic and non-deterministic
True or False: The minimum time between sporadic events must be known
True, or else all events may not be captured
To detect an event, input signals can be ___________________________ to synchronize real-time events with the program
Sampled periodically
If you are given the task execution time, T, and the period, P, how can you calculate the load on the CPU?
Divide the task execution time by the period (L = T/P)
If you are given multiple task execution times and periods, how can you calculate the load on the CPU?
Find the sum of all execution times divided by their periods (L = T1/P1 + T2/P2 + … + Tn/Pn)
True or False: The necessary condition for a design to be realizable is L > 1
False, L (load on CPU) must be less than or equal to 1
True or False: Given the time required to make one pass through the sampling loop, S, and the time required to update the outputs, D, the worst-case response time, R, is:
R <= S + D ~= 2S
True
What are the three different types of event detection
- Level detection
- Flag detection
- Edge detection
Event detection can be done by _________ in a free-running event loop
Polling
What is the formula for polling time in a level-detection free-running event loop
T_poll = T_det + T_srv < T_ep + T_et_2 - T_et_1
What is the formula for polling time in a flag-based free-running event loop
T_poll = T_det + T_srv < T_ep
What is the condition to detect edges in a free-running event loop
2*T_det + T_srv < T_ep
What is the formula for the response time from an event becoming active to the time the response is made in a free-running event loop
T_R = T_poll + T_det + T_srv + T_cir
True or False: CPU load can be decreased by using hardware
True
An ______________ is a hardware solution for both event detection and changing the program flow
Interrupt
What is a problem with using interrupts in multitask systems?
It results in nondeterministic timings and can interrupt a task in the middle of it. To address this, the CPU context must be saved prior to servicing the interrupt (referred to as a context switch)
What is a timed event loop?
A programming construct that executes code at regular intervals, ensuring multiple tasks can run at regular intervals