Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 144
Q3141:
Which Windows object is used to implement mutual exclusion?
A. Critical Section
B. Mutex
C. Queue
D. Event
Correct Answer: B
Chapter: 144
Q3142:
Which Windows function is used to create a mutex?
A. WaitMutex()
B. OpenMutex()
C. CreateMutex()
D. BuildMutex()
Correct Answer: C
Chapter: 144
Q3143:
The function used to release ownership of a mutex is _______.
A. CloseMutex()
B. EndMutex()
C. ReleaseMutex()
D. OpenMutex()
Correct Answer: C
Chapter: 144
Q3144:
A mutex allows mutual exclusion between threads in _______.
A. same function
B. looping process
C. different processes
D. compiled binaries
Correct Answer: C
Chapter: 144
Q3145:
Which of the following functions can be used to wait for a mutex?
A. WaitOne()
B. WaitHandle()
C. WaitForSingleObject()
D. SleepThread()
Correct Answer: C
Chapter: 144
Q3146:
What is the return value of CreateMutex() on failure?
A. NULL
B. 1
C. -1
D. 1
Correct Answer: A
Chapter: 144
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
Correct Answer: D
Chapter: 144
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
Correct Answer: C
Chapter: 144
Q3149:
Which of the following is NOT a valid function to manage mutex?
A. CreateMutex()
B. ReleaseMutex()
C. OpenMutex()
D. CloseThread()
Correct Answer: D
Chapter: 144
Q3150:
bInitialOwner parameter in CreateMutex() assigns ownership to _______.
A. all threads
B. calling thread
C. a new thread
D. operating system
Correct Answer: B
Chapter: 144
Q3151:
Mutexes can be named and have _______.
A. values
B. flags
C. handles
D. properties
Correct Answer: C
Chapter: 144
Q3152:
The parameter lpMutexName in CreateMutex() refers to the _______.
A. thread name
B. mutex name
C. file name
D. process name
Correct Answer: B
Chapter: 144
Q3153:
To open an existing named mutex, we use _______.
A. OpenMutex()
B. UnlockMutex()
C. CallMutex()
D. WaitForMutex()
Correct Answer: A
Chapter: 144
Q3154:
A thread can synchronize with other threads across processes using _______.
A. CRITICAL_SECTION
B. OpenMutex()
C. CloseHandle()
D. SetMutex()
Correct Answer: B
Chapter: 144
Q3155:
If a mutex is abandoned by a terminating thread, it becomes _______.
A. released
B. blocked
C. signaled
D. terminated
Correct Answer: C
Chapter: 144
Q3156:
ReleaseMutex() fails if _______.
A. the mutex is not owned by the thread
B. the mutex is released already
C. the thread is terminated
D. the mutex is recursive
Correct Answer: A
Chapter: 144
Q3157:
A mutex can be acquired using _______.
A. WaitOne()
B. WaitForMultipleObjects()
C. SleepThread()
D. CloseHandle()
Correct Answer: B
Chapter: 144
Q3158:
Mutexes are especially useful for synchronizing threads in _______.
A. loops
B. memory maps
C. files
D. procedures
Correct Answer: B
Chapter: 144
Q3159:
A thread should release a mutex as soon as possible to avoid _______.
A. race conditions
B. resource starvation
C. thread priority
D. deadlocks
Correct Answer: D
Chapter: 144
Q3160:
Ownership of mutex is released using _______.
A. WaitForMutex()
B. CloseHandle()
C. ReleaseMutex()
D. OpenMutex()
Correct Answer: C

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now