Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 146
Q3221:
CRITICAL_SECTIONs are usually preferred when _______.
A. sharing mutexes across processes
B. is required
C. minimal overhead and faster locking are needed
D. inter-process communication is needed
Correct Answer: C
Chapter: 146
Q3222:
Mutexes provide _______ functionality that CRITICAL_SECTIONs lack.
A. recursive locking
B. naming and timeout
C. waiting for multiple objects
D. direct memory access
Correct Answer: B
Chapter: 146
Q3223:
Threads that create mutexes can acquire immediate ownership, which is a _______.
A. convenience
B. performance issue
C. security risk
D. design flaw
Correct Answer: A
Chapter: 146
Q3224:
CRITICAL_SECTIONs are suitable only for synchronization within a _______.
A. single process
B. multiple processes
C. multiple machines
D. network
Correct Answer: C
Chapter: 146
Q3225:
The key disadvantage of mutexes compared to CRITICAL_SECTIONs is _______.
A. higher overhead
B. lack of timeout
C. support for inter-process sharing
D. slower creation time
Correct Answer: A
Chapter: 146
Q3226:
Which Windows API function creates or opens a mutex?
A. CreateMutex()
B. ReleaseMutex()
C. OpenMutex()
D. CloseHandle()
Correct Answer: A
Chapter: 146
Q3227:
Which Windows API function releases ownership of a mutex?
A. ReleaseMutex()
B. CreateMutex()
C. WaitForSingleObject()
D. OpenMutex()
Correct Answer: A
Chapter: 146
Q3228:
The abbreviation "CS" stands for _______ in Windows synchronization objects.
A. Concurrent Section
B. Critical Section
C. Control Semaphore
D. Concurrent Semaphore
Correct Answer: B
Chapter: 147
Q3229:
A semaphore is a data structure used for _______.
A. process synchronization
B. concurrency control
C. memory management
D. thread scheduling
Correct Answer: B
Chapter: 147
Q3230:
A semaphore is in a signaled state when its count is _______.
A. less than 0
B. greater than 0
C. equal to 0
D. negative
Correct Answer: A
Chapter: 147
Q3231:
The semaphore count is _______ when a waiting thread is released.
A. incremented
B. decremented
C. reset
D. ignored
Correct Answer: B
Chapter: 147
Q3232:
Which of the following functions is used to create a semaphore in Windows API?
A. OpenSemaphore()
B. ReleaseSemaphore()
C. CreateSemaphore()
D. WaitSemaphore()
Correct Answer: C
Chapter: 147
Q3233:
A semaphore is unsignaled when the count is _______.
A. greater than 0
B. less than 0
C. equal to 0
D. negative
Correct Answer: C
Chapter: 147
Q3234:
lpPreviousCount in ReleaseSemaphore() provides the count _______ the release.
A. before
B. after
C. during
D. ignored
Correct Answer: A
Chapter: 147
Q3235:
cReleaseCount in ReleaseSemaphore() must be _______.
A. less than 0
B. zero
C. or greater than 0
D. greater than 0
Correct Answer: D
Chapter: 147
Q3236:
Any thread can release a semaphore, meaning _______.
A. only the owner can release
B. it has no concept of abandonment
C. release is restricted
D. to the thread that acquired it
Correct Answer: B
Chapter: 147
Q3237:
If a semaphore release causes the count to exceed its maximum, the count will _______.
A. reset
B. remain unchanged
C. increment twice
D. decrement
Correct Answer: B
Chapter: 147
Q3238:
Which of the following is NOT a valid semaphore function?
A. CreateSemaphoreEx()
B. OpenSemaphore()
C. WaitSemaphore()
D. ReleaseSemaphore()
Correct Answer: C
Chapter: 147
Q3239:
Semaphore count is a _______ type value that controls the state of the semaphore.
A. numeric
B. boolean
C. string
D. object
Correct Answer: A
Chapter: 147
Q3240:
A NULL return from CreateSemaphore() indicates _______.
A. success
B. failure
C. overflow
D. underflow
Correct Answer: B

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now