System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 139
Q3001:
A blocked thread gets access to the critical section when ________ is called.
A. ResetCriticalSection()
B. DeleteCriticalSection()
C. LeaveCriticalSection()
D. ReleaseThread()
Correct Answer:
C
Chapter: 139
Q3002:
A thread will remain blocked forever if ________.
A. system halts
B. no Enter call is made
C. no Leave call is made
D. critical section is empty
Correct Answer:
C
Chapter: 139
Q3003:
CRITICAL_SECTION supports ________ functions to allow reentry.
A. secure
B. non-thread-safe
C. recursive
D. conditional
Correct Answer:
C
Chapter: 139
Q3004:
If TryEnterCriticalSection returns FALSE, it means the CS is ________.
A. unallocated
B. uninitialized
C. owned by another thread
D. deleted
Correct Answer:
C
Chapter: 139
Q3005:
CRITICAL_SECTION objects provide better performance over ________ objects.
A. synchronization
B. user space
C. kernel space
D. timer
Correct Answer:
C
Chapter: 139
Q3006:
Only ________ thread can access the CS variable at any time.
A. one
B. two
C. multiple
D. no
Correct Answer:
A
Chapter: 139
Q3007:
The EnterCriticalSection() function causes ________ if another thread is inside the CS.
A. timeout
B. error
C. blocking
D. retry
Correct Answer:
C
Chapter: 139
Q3008:
TryEnterCriticalSection() is used to ________ critical section access.
A. enforce
B. poll
C. skip
D. reject
Correct Answer:
B
Chapter: 139
Q3009:
There is ________ timeout mechanism for EnterCriticalSection().
A. a short
B. an adjustable
C. a fixed
D. no
Correct Answer:
D
Chapter: 139
Q3010:
The purpose of recursive critical sections is to support ________ functions.
A. infinite
B. recursive
C. exclusive
D. static
Correct Answer:
B
Chapter: 139
Q3011:
A thread must call ________ times LeaveCriticalSection() as it called EnterCriticalSection().
A. double
B. multiple
C. same number of
D. one less
Correct Answer:
C
Chapter: 139
Q3012:
The CS object can be re-entered by the same thread due to ________ support.
A. multiple process
B. mutex
C. recursive
D. file lock
Correct Answer:
C
Chapter: 139
Q3013:
CRITICAL_SECTION is a ________ locking mechanism.
A. user-level
B. process-level
C. file-based
D. system-level
Correct Answer:
A
Chapter: 139
Q3014:
Unlike Mutex, CRITICAL_SECTION cannot be used across ________.
A. DLLs
B. libraries
C. threads
D. processes
Correct Answer:
D
Chapter: 139
Q3015:
CRITICAL_SECTION is considered ________ than mutex in intra-process scenarios.
A. heavier
B. slower
C. lighter
D. complex
Correct Answer:
C
Chapter: 139
Q3016:
The function ________ is used to non-blockingly test access to a critical section.
A. WaitForObject()
B. Sleep()
C. TryEnterCriticalSection()
D. PollSection()
Correct Answer:
C
Chapter: 140
Q3017:
What does the CRITICAL_SECTION construct help protect?
A. file names
B. thread priorities
C. shared variables
D. CPU registers
Correct Answer:
C
Chapter: 140
Q3018:
Shared variables like number of requests must be modified by ________.
A. all threads at once
B. multiple processes simultaneously
C. only one thread at a time
D. kernel modules
Correct Answer:
C
Chapter: 140
Q3019:
In multithreaded applications, access to shared variables should be ________.
A. sequential
B. concurrent
C. asynchronous
D. uncontrolled
Correct Answer:
A
Chapter: 140
Q3020:
CRITICAL_SECTION ensures ________ access to shared variables.
A. random
B. secure
C. synchronized
D. delayed
Correct Answer:
C