System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q2821: A solution that gives each thread its own variable avoids the need for ________.
- A: Memory
- B: Locks
- C: Global flags
- D: Compilation
View Answer
C
Q2822: In the global flag solution, what can cause synchronization to fail?
- A: Memory leak
- B: Deadlock
- C: Thread preemption
- D: Stack overflow
View Answer
C
Q2823: A thread should set flag to TRUE ________ modifying a shared variable.
- A: While
- B: After
- C: Before
- D: Instead of
View Answer
C
Q2824: A critical section is a part of code that accesses ________ data.
- A: Unused
- B: Shared
- C: Read-only
- D: Public
View Answer
B
Q2825: If FLAG is not properly managed, threads may enter ________ at the same time.
- A: Sleep mode
- B: Debug mode
- C: Critical region
- D: Compilation
View Answer
C
Q2826: Threads entering a critical section together can cause ________.
- A: Increased performance
- B: Accurate results
- C: Data corruption
- D: Faster execution
View Answer
C
Q2827: Which of the following is not an ideal solution to the critical section problem?
- A: Global flag
- B: Mutual exclusion
- C: Locks
- D: Preemption
View Answer
D
Q2828: What does the volatile qualifier in C ensure about variable access?
- A: It is accessed from register
- B: It is never accessed
- C: It is always accessed from memory
- D: It is only read once
View Answer
C
Q2829: Volatile qualifier should be used only when ________.
- A: Speed is essential
- B: Variable is read once
- C: Necessary to avoid optimization issues
- D: Code is not shared
View Answer
C
Q2830: A volatile variable is always stored in ________ after an operation.
- A: CPU
- B: Stack
- C: Memory
- D: Cache
View Answer
C