Site icon T4Tutorials.com

Context Switching – Real-time Systems MCQs

1. What is context switching in a real-time system?

(A) Increasing CPU idle time


(B) Executing tasks sequentially without preemption


(C) Saving the state of a running task and restoring another task’s state


(D) Reducing task periods automatically



2. Which of the following is saved during a context switch?

(A) CPU registers, program counter, and stack pointer


(B) Disk scheduling parameters only


(C) Task period only


(D) Task WCET only



3. Context switching occurs when:

(A) A higher-priority task preempts a lower-priority task


(B) Tasks execute sequentially without preemption


(C) CPU is idle


(D) Task deadlines are ignored



4. Which of the following affects context switch time?

(A) CPU speed and number of registers to save/restore


(B) Task period only


(C) Task deadline only


(D) File system speed



5. Excessive context switching can lead to:

(A) Increased CPU overhead and reduced system performance


(B) Reduced WCET automatically


(C) Longer task periods


(D) Ignored deadlines



6. In real-time systems, context switching should be:

(A) Maximized for flexibility


(B) Minimized to ensure predictable task execution


(C) Ignored


(D) Dependent only on memory size



7. Which RTOS service is responsible for performing context switches?

(A) Disk scheduler


(B) Memory manager


(C) Scheduler


(D) Task communication module



8. A non-preemptive RTOS requires context switching:

(A) Frequently, regardless of task execution


(B) At every timer tick


(C) Only when a task voluntarily yields or completes


(D) Never



9. Preemptive RTOS context switching occurs:

(A) Only during idle time


(B) Only after task completion


(C) When a higher-priority task becomes ready


(D) Never



10. Which statement is TRUE about context switching?

(A) It always decreases WCET


(B) It reduces task periods automatically


(C) It ignores deadlines


(D) It introduces some CPU overhead but is necessary for multitasking



11. What is the impact of frequent context switches on real-time task deadlines?

(A) It reduces task periods


(B) It decreases task WCET


(C) It improves CPU idle time only


(D) It may increase response time and cause deadline misses



12. Which type of RTOS tries to minimize context switching overhead?

(A) Non-preemptive RTOS only


(B) Batch-processing OS


(C) Desktop OS


(D) Hard real-time RTOS



13. Which of the following is saved in the task control block (TCB) for context switching?

(A) Disk I/O parameters only


(B) Task state, program counter, stack pointer, and CPU registers


(C) Task WCET only


(D) File system info



14. Context switching time is considered in:

(A) CPU idle time only


(B) Disk scheduling only


(C) Task period assignment only


(D) Scheduling and worst-case response time analysis



15. A context switch involves:

(A) Ignoring task priorities


(B) Only preempting the current task


(C) Saving the current task state and restoring the next task’s state


(D) Reducing CPU speed



16. Which factor increases context switch overhead?

(A) Task period only


(B) Large number of registers and complex task states


(C) Task deadline only


(D) Disk I/O speed only



17. When a high-priority task becomes ready, context switching ensures:

(A) CPU idle time increases


(B) Lower-priority tasks continue uninterrupted


(C) Tasks execute sequentially only


(D) Immediate preemption of lower-priority tasks



18. In real-time systems, frequent context switching is undesirable because:

(A) It reduces WCET automatically


(B) It improves CPU utilization only


(C) It can reduce system determinism and predictability


(D) It ignores task deadlines



19. Context switching is essential for:

(A) Reducing task priorities


(B) Increasing CPU idle time


(C) Multitasking and handling multiple ready tasks in RTOS


(D) Ignoring deadlines



20. Which practice reduces context switching overhead in RTOS?

(A) Keeping tasks short and minimizing preemption


(B) Executing long tasks only


(C) Ignoring task priorities


(D) Using batch scheduling only



Exit mobile version