Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 95
Q2081:
Which of the following should not be relied upon after ExitProcess()?
A. All memory is freed
B. Resource handles are closed
C. Termination handlers run
D. Threads are safe
Correct Answer: C
Chapter: 95
Q2082:
Which type does ExitProcess() return?
A. BOOL
B. VOID
C. DWORD
D. LPSTR
Correct Answer: B
Chapter: 95
Q2083:
Which API is used to close a process from another process context?
A. CloseHandle()
B. ExitThread()
C. TerminateProcess()
D. SuspendProcess()
Correct Answer: C
Chapter: 96
Q2084:
Which function is used to wait for a single object in Windows?
A. WaitForObject()
B. WaitForAllObjects()
C. WaitForSingleObject()
D. WaitProcessObject()
Correct Answer: C
Chapter: 96
Q2085:
Which function is used to wait for multiple objects in Windows?
A. WaitGroup()
B. WaitForMultipleObjects()
C. WaitArray()
D. WaitManyHandles()
Correct Answer: B
Chapter: 96
Q2086:
What type is the first parameter of WaitForSingleObject()?
A. HANDLE
B. DWORD
C. BOOL
D. CONST HANDLE
Correct Answer: C
Chapter: 96
Q2087:
In WaitForMultipleObjects(), what does nCount represent?
A. number of threads
B. number of events
C. number of handles
D. number of processes
Correct Answer: C
Chapter: 96
Q2088:
In WaitForMultipleObjects(), lpHandles is ______.
A. a pointer to a structure
B. a handle to an object
C. a pointer to an array of handles
D. a file handle
Correct Answer: C
Chapter: 96
Q2089:
Which parameter in WaitForMultipleObjects specifies whether to wait for all objects?
A. nCount
B. dwMilliseconds
C. lpHandles
D. bWaitAll
Correct Answer: D
Chapter: 96
Q2090:
What does dwMilliseconds = INFINITE indicate in wait functions?
A. zero wait time
B. no timeout
C. indefinite wait
D. object not found
Correct Answer: C
Chapter: 96
Q2091:
The return value WAIT_OBJECT_0 indicates ______.
A. object was not found
B. timeout occurred
C. object is signaled
D. process failed
Correct Answer: C
Chapter: 96
Q2092:
The return value WAIT_TIMEDOUT indicates ______.
A. wait completed
B. object was abandoned
C. wait failed
D. wait timed out
Correct Answer: D
Chapter: 96
Q2093:
The return value WAIT_FAILED means ______.
A. all handles were signaled
B. wait timed out
C. object signaled
D. function failed
Correct Answer: D
Chapter: 96
Q2094:
WAIT_ABANDONED_0 indicates that the ______.
A. object was deleted
B. mutex was not released
C. timeout expired
D. thread ended unexpectedly
Correct Answer: B
Chapter: 96
Q2095:
WaitForSingleObject() is part of the Windows API.
A. A
B. B
Correct Answer: A
Chapter: 96
Q2096:
WaitForMultipleObjects() can wait on up to MAXIMUM_WAIT_OBJECTS handles.
A. A
B. B
Correct Answer: A
Chapter: 96
Q2097:
A wait function in Windows is used for process synchronization.
A. A
B. B
Correct Answer: A
Chapter: 96
Q2098:
WaitForSingleObject() allows waiting on an array of objects.
A. A
B. B
Correct Answer: B
Chapter: 96
Q2099:
The timeout parameter in wait functions can be set to 0 for no wait.
A. A
B. B
Correct Answer: A
Chapter: 96
Q2100:
In WaitForMultipleObjects, bWaitAll = TRUE waits for all objects.
A. A
B. B
Correct Answer: A

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now