20 Questions
What is the main difference between soft and hard real-time systems?
Soft real-time systems have flexible deadlines, while hard real-time systems have strict deadlines.
In real-time CPU scheduling, event latency refers to the time it takes to service an event after it occurs.
True
What are the two types of latencies that affect performance in real-time CPU scheduling?
Interrupt latency and dispatch latency
In hard real-time systems, tasks must be serviced by their ____________________.
deadlines
Match the following real-time CPU scheduling concepts with their definitions:
Event Latency = Time from event occurrence to service Interrupt Latency = Time from interrupt arrival to start of routine Dispatch Latency = Time for scheduler to switch processes
What is the conflict phase of dispatch latency?
Preemption of any process running in kernel mode
What is the period of process P1?
50
Process P2 has a CPU burst of 25.
False
What is the time at which process P2 misses its deadline?
80
The POSIX.1b standard provides functions for managing ___________ threads.
real-time
Match the POSIX scheduling classes with their descriptions:
SCHED_FIFO = FCFS strategy with a FIFO queue SCHED_RR = Time-slicing for threads of equal priority
How many scheduling classes are defined by POSIX.1b for real-time threads?
2
What is the main goal of releasing resources by low-priority processes?
To give priority to high-priority processes
Rate Monotonic Scheduling guarantees hard real-time.
False
What is the rate of a periodic task?
1/p
In Rate Monotonic Scheduling, a priority is assigned based on the ______________ of its period.
inverse
What is the CPU utilization of process P1 in the given example?
0.40
In Rate Monotonic Scheduling, shorter periods always result in lower priority.
False
Match the following processes with their periods:
P1 = 50 P2 = 100
What is the primary characteristic of a periodic process?
Requires CPU at constant intervals
Study Notes
Real-Time CPU Scheduling
- Can present obvious challenges
- Soft real-time systems: critical real-time tasks have the highest priority, but no guarantee as to when tasks will be scheduled
- Hard real-time systems: tasks must be serviced by their deadlines
Event Latency
- The amount of time that elapses from when an event occurs to when it is serviced
- Two types of latencies affect performance:
- Interrupt latency: time from arrival of interrupt to start of routine that services interrupt
- Dispatch latency: time for schedule to take current process off CPU and switch to another
Dispatch Latency
- Conflict phase of dispatch latency:
- Preemption of any process running in kernel mode
- Release by low-priority process of resources needed by high-priority processes
Priority-based Scheduling
- For real-time scheduling, scheduler must support preemptive, priority-based scheduling
- Only guarantees soft real-time, not hard real-time
- Processes have new characteristics: periodic ones require CPU at constant intervals
- Has processing time t, deadline d, period p, where 0 ≤ t ≤ d ≤ p
- Rate of periodic task is 1/p
Rate Monotonic Scheduling
- A priority is assigned based on the inverse of its period
- Shorter periods = higher priority; longer periods = lower priority
- CPU utilization of a process Pi is the ratio of its burst to its period — ti / pi
POSIX Real-Time Scheduling
- The POSIX.1b standard provides functions for managing real-time threads
- Defines two scheduling classes for real-time threads:
- SCHED_FIFO: threads are scheduled using a FCFS strategy with a FIFO queue; no time-slicing for threads of equal priority
- SCHED_RR: similar to SCHED_FIFO except time-slicing occurs for threads of equal priority
- Defines two functions for getting and setting scheduling policy:
- pthread_attr_getsched_policy(pthread_attr_t *attr, int *policy)
- pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
This quiz covers real-time CPU scheduling in operating systems, including soft and hard real-time systems, task priority, and deadlines.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free