System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 164
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
Correct Answer:
B
Chapter: 164
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
Correct Answer:
B
Chapter: 164
Q3643:
SRW APIs provide ______ access to shared resources.
A. non-blocking
B. concurrent
C. synchronous
D. managed
Correct Answer:
B
Chapter: 164
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
Correct Answer:
B
Chapter: 164
Q3645:
In exclusive mode, SRW APIs ensure ______.
A. parallel reading
B. only read access
C. exclusive write access
D. skip locking
Correct Answer:
C
Chapter: 164
Q3646:
InitializeSRWLock() must be called ______ using the SRW.
A. after
B. during
C. before
D. in parallel
Correct Answer:
C
Chapter: 164
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
Correct Answer:
B
Chapter: 165
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
Correct Answer:
C
Chapter: 165
Q3649:
SRWs are considered __________ in terms of resource requirements.
A. heavy
B. light
C. irrelevant
D. unpredictable
Correct Answer:
B
Chapter: 165
Q3650:
SRWs do not allow _________ because it requires maintaining the stack.
A. critical sections
B. shared access
C. recursion
D. thread priority
Correct Answer:
C
Chapter: 165
Q3651:
Which of the following best describes SRWs compared to Critical Sections?
A. Twice as slow
B. Equal in speed
C. Twice as fast
D. Dependent on OS
Correct Answer:
C
Chapter: 165
Q3652:
In shared mode of SRWs, the locked variable ________ be read.
A. cannot
B. can sometimes
C. can always
D. needs to wait for unlocking
Correct Answer:
B
Chapter: 165
Q3653:
Which locking mechanism was found almost twice as fast as Critical Sections in performance evaluations?
A. Mutex
B. Events
C. SRWs
D. Semaphores
Correct Answer:
C
Chapter: 165
Q3654:
SRWs are designed to minimize __________ requirements.
A. coding
B. syntax
C. resource
D. control flow
Correct Answer:
C
Chapter: 165
Q3655:
In recursion, ________ is required, making SRWs unsuitable.
A. shared access
B. memory stack
C. critical section
D. thread handle
Correct Answer:
B
Chapter: 165
Q3656:
Which of the following is **not** an advantage of SRWs?
A. Shared access
B. Lightweight
C. Supports recursion
D. Fast performance
Correct Answer:
C
Chapter: 165
Q3657:
SRWs cannot be used efficiently in ________ based functions.
A. simple
B. stack-intensive
C. single-threaded
D. loop-based
Correct Answer:
B
Chapter: 165
Q3658:
SRWs in shared mode do not require the thread to ______.
A. wait for release
B. modify stack
C. start new thread
D. write to file
Correct Answer:
A
Chapter: 165
Q3659:
Which aspect of SRWs makes them beneficial for multithreaded programs?
A. Recursion allowance
B. High memory consumption
C. Lightweight locking
D. Complex implementation
Correct Answer:
C
Chapter: 166
Q3660:
What is a common issue when the number of threads increases?
A. Increased speed
B. Page faults
C. Decreased memory usage
D. Fewer context switches
Correct Answer:
B