Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 138
Q2981:
A thread that accesses a locked file without synchronization can cause ________.
A. thread safety
B. race condition
C. modularity
D. garbage collection
Correct Answer: B
Chapter: 138
Q2982:
Using too many synchronization objects without planning may lead to ________.
A. optimized execution
B. file sharing
C. deadlocks
D. fast performance
Correct Answer: C
Chapter: 138
Q2983:
The function WaitForSingleObject() returns when the object is ________.
A. hidden
B. available
C. locked
D. null
Correct Answer: B
Chapter: 138
Q2984:
Synchronization objects like Mutexes and Semaphores exist to avoid ________.
A. I/O failures
B. deadlocks
C. resource conflicts
D. function duplication
Correct Answer: C
Chapter: 138
Q2985:
Critical Sections are mainly used in ________.
A. multiple applications
B. single-threaded processes
C. single-process multithreaded apps
D. network protocols
Correct Answer: C
Chapter: 138
Q2986:
Semaphores use a ________ to count how many threads can access the resource.
A. timer
B. counter
C. flag
D. register
Correct Answer: B
Chapter: 138
Q2987:
Using SRW locks can improve performance over traditional ________.
A. threads
B. critical sections
C. timers
D. file streams
Correct Answer: B
Chapter: 139
Q2988:
A critical section is a part of code that can be executed by ________ at a time.
A. all threads
B. multiple processes
C. one thread
D. two processes
Correct Answer: C
Chapter: 139
Q2989:
Which object does Windows provide for solving the critical section problem?
A. MUTEX_OBJECT
B. KERNEL_LOCK
C. CRITICAL_SECTION
D. THREAD_MONITOR
Correct Answer: C
Chapter: 139
Q2990:
CRITICAL_SECTION objects are initialized using which function?
A. InitCS()
B. InitializeCriticalSection()
C. StartCriticalSection()
D. BeginSection()
Correct Answer: B
Chapter: 139
Q2991:
The function to delete a CRITICAL_SECTION is ________.
A. EndCS()
B. DeleteSection()
C. DeleteCriticalSection()
D. RemoveCS()
Correct Answer: C
Chapter: 139
Q2992:
CRITICAL_SECTION objects are used only in ________.
A. user space
B. kernel space
C. network sockets
D. system registry
Correct Answer: A
Chapter: 139
Q2993:
CRITICAL_SECTION objects cannot be ________ among processes.
A. copied
B. shared
C. nested
D. terminated
Correct Answer: B
Chapter: 139
Q2994:
When a thread enters the critical section, it should call ________ on exit.
A. ExitCS()
B. LeaveCS()
C. LeaveCriticalSection()
D. FinishCS()
Correct Answer: C
Chapter: 139
Q2995:
A call to LeaveCriticalSection() must match a call to ________.
A. LockCS()
B. InitCS()
C. EnterCriticalSection()
D. UnlockCS()
Correct Answer: C
Chapter: 139
Q2996:
If a thread tries to enter an already-occupied CRITICAL_SECTION, it gets ________.
A. terminated
B. blocked
C. re-routed
D. idle
Correct Answer: B
Chapter: 139
Q2997:
Recursive critical section means a thread can ________.
A. block itself
B. enter multiple times
C. delete the section
D. access it without lock
Correct Answer: B
Chapter: 139
Q2998:
Windows maintains a ________ when recursive entry into critical sections occurs.
A. stack
B. log
C. counter
D. semaphore
Correct Answer: C
Chapter: 139
Q2999:
The function TryEnterCriticalSection() returns TRUE if ________.
A. thread is blocked
B. CRITICAL_SECTION is deleted
C. current thread owns the section
D. entry is denied
Correct Answer: C
Chapter: 139
Q3000:
CRITICAL_SECTION objects ________ handles.
A. require
B. have
C. do not have
D. store
Correct Answer: C

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now