System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q3641: When using SRWs in shared mode, the variable being accessed ______.
- A: must be updated
- B: should remain unchanged
- C: is always locked
- D: is switched to exclusive mode
View Answer
B
Q3642: AcquireSRWLockExclusive() allows ______.
- A: multiple threads to read
- B: only one thread to write
- C: recursion on SRW
- D: lock upgrade from shared to exclusive
View Answer
B
Q3643: SRW APIs provide ______ access to shared resources.
- A: non-blocking
- B: concurrent
- C: synchronous
- D: managed
View Answer
B
Q3644: Using shared mode for SRWs is suitable when ______.
- A: thread updates shared data
- B: thread only reads data
- C: thread closes a handle
- D: thread writes to file
View Answer
B
Q3645: In exclusive mode, SRW APIs ensure ______.
- A: parallel reading
- B: only read access
- C: exclusive write access
- D: skip locking
View Answer
C
Q3646: InitializeSRWLock() must be called ______ using the SRW.
- A: after
- B: during
- C: before
- D: in parallel
View Answer
C
Q3647: Which API pair is used for read-only thread access to SRW?
- A: AcquireSRWLockExclusive & ReleaseSRWLockExclusive
- B: AcquireSRWLockShared & ReleaseSRWLockShared
- C: InitializeSRWLock & ReleaseSRWLockShared
- D: InitSRWLock & AcquireSRWLockShared
View Answer
B
Q3648: What is the primary benefit of using SRWs in shared mode?
- A: Allows recursion
- B: Prevents all threads from accessing
- C: Allows reading a locked variable
- D: Slows execution
View Answer
C
Q3649: SRWs are considered __________ in terms of resource requirements.
- A: heavy
- B: light
- C: irrelevant
- D: unpredictable
View Answer
B
Q3650: SRWs do not allow _________ because it requires maintaining the stack.
- A: critical sections
- B: shared access
- C: recursion
- D: thread priority
View Answer
C