System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q3141: Which Windows object is used to implement mutual exclusion?
- A: Critical Section
- B: Mutex
- C: Queue
- D: Event
View Answer
B
Q3142: Which Windows function is used to create a mutex?
- A: WaitMutex()
- B: OpenMutex()
- C: CreateMutex()
- D: BuildMutex()
View Answer
C
Q3143: The function used to release ownership of a mutex is _______.
- A: CloseMutex()
- B: EndMutex()
- C: ReleaseMutex()
- D: OpenMutex()
View Answer
C
Q3144: A mutex allows mutual exclusion between threads in _______.
- A: same function
- B: looping process
- C: different processes
- D: compiled binaries
View Answer
C
Q3145: Which of the following functions can be used to wait for a mutex?
- A: WaitOne()
- B: WaitHandle()
- C: WaitForSingleObject()
- D: SleepThread()
View Answer
C
Q3146: What is the return value of CreateMutex() on failure?
- A: NULL
- B: 1
- C: -1
- D: 1
View Answer
A
Q3147: If a thread already owns a mutex, trying to acquire it again will _______.
- A: block the thread
- B: release the mutex
- C: cause error
- D: not block the thread
View Answer
D
Q3148: The recursive property of mutex means that _______.
- A: mutex never resets
- B: mutex cannot be created again
- C: mutex can be acquired multiple times by the same thread
- D: mutex is faster than semaphore
View Answer
C
Q3149: Which of the following is NOT a valid function to manage mutex?
- A: CreateMutex()
- B: ReleaseMutex()
- C: OpenMutex()
- D: CloseThread()
View Answer
D
Q3150: bInitialOwner parameter in CreateMutex() assigns ownership to _______.
- A: all threads
- B: calling thread
- C: a new thread
- D: operating system
View Answer
B