Q1. Explain Pthread Scheduling of Hard Real Time Systems.
Ans. Pthread defines two scheduling classes for real-time threads:
SCHED_FIFO schedules threads according to a first-come, first-served policy using a FIFO queue as outlined. However, there is no time slicing among threads of equal priority. Therefore, the highest-priority real-time thread at the front of the FIFO queue will be granted the CPU until it terminates or blocks.
- SCHED_RR (For Round-Robin)
SCHED_RR is similar to SCHED_FIFO except that it provides time slicing among threads of equal priority.