Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 169
Q3721:
Thread pools are created and assigned _______.
A. thread objects
B. memory blocks
C. processes
D. data streams
Correct Answer: A
Chapter: 169
Q3722:
The thread objects in a thread pool execute via a _______.
A. loop
B. function
C. callback
D. pointer
Correct Answer: C
Chapter: 169
Q3723:
In the API CreateThreadpoolWork, the parameter pfnwk represents a pointer to the _______.
A. callback function
B. work object
C. thread handle
D. callback instance
Correct Answer: A
Chapter: 169
Q3724:
The pv parameter in CreateThreadpoolWork API is _______.
A. required
B. a thread ID
C. an optional value passed to the callback
D. function parameter
Correct Answer: C
Chapter: 169
Q3725:
The pcbe parameter in CreateThreadpoolWork usually uses the _______.
A. default TP_CALLBACK_ENVIRON structure
B. custom structure
C. thread pool handle
D. thread ID
Correct Answer: A
Chapter: 169
Q3726:
The API SubmitThreadpoolWork is used to _______.
A. start a new thread
B. register a work object
C. cancel a thread
D. wait for a thread to finish
Correct Answer: B
Chapter: 169
Q3727:
The callback function associated with the work object in SubmitThreadpoolWork is executed how many times?
A. Once
B. Multiple times
C. Depends on input
D. Depends on CPU cores
Correct Answer: A
Chapter: 169
Q3728:
Which scheduler decides the thread used to run the callback function?
A. Programmer
B. Kernel
C. Windows Service
D. User
Correct Answer: B
Chapter: 169
Q3729:
Programmers do not need to manage threads when using thread pools, but they must still enforce _______.
A. thread creation
B. synchronization
C. memory allocation
D. thread termination
Correct Answer: B
Chapter: 169
Q3730:
The API WaitForThreadpoolWorkCallbacks will return after _______.
A. a timeout period
B. all callback functions have returned
C. any callback starts
D. all callbacks are canceled
Correct Answer: B
Chapter: 169
Q3731:
WaitForThreadpoolWorkCallbacks can optionally cancel work objects whose callbacks have not yet _______.
A. started
B. finished
C. been scheduled
D. been created
Correct Answer: A
Chapter: 169
Q3732:
In WaitForThreadpoolWorkCallbacks, the second parameter is used to specify whether to cancel _______.
A. callbacks that have not started
B. callbacks in progress
C. all callbacks
D. none
Correct Answer: A
Chapter: 169
Q3733:
In the callback function WorkCallback, the parameter Context corresponds to the value obtained from _______.
A. parameter pv
B. thread ID
C. work object
D. callback instance
Correct Answer: A
Chapter: 169
Q3734:
The Instance parameter in WorkCallback provides _______.
A. thread ID
B. callback instance
C. worker object
D. callback function
Correct Answer: B
Chapter: 169
Q3735:
The CallbackMayRunLong flag informs the kernel that the callback may run _______.
A. for a short time
B. for a long time
C. only once
D. multiple times
Correct Answer: B
Chapter: 169
Q3736:
The SubmitThreadpoolWork API requires the work object reference returned by _______.
A. CreateThreadpoolWork
B. WaitForThreadpoolWorkCallbacks
C. WorkCallback
D. CallbackMayRunLong
Correct Answer: A
Chapter: 169
Q3737:
The thread pool automatically adjusts the number of worker threads based on _______.
A. process behavior
B. CPU speed
C. memory usage
D. user input
Correct Answer: A
Chapter: 169
Q3738:
Applications can set _______ bounds on the number of worker threads in the thread pool.
A. upper and lower
B. only upper
C. only lower
D. none
Correct Answer: A
Chapter: 169
Q3739:
The work object handle used in thread pool APIs is of type _______.
A. PTP_WORK
B. PTP_CALLBACK
C. PVOID
D. PTP_THREAD
Correct Answer: A
Chapter: 169
Q3740:
Thread pool callback functions should never call _______ within their callback function.
A. _endthreadex()
B. ExitThread()
C. CreateThread()
D. Sleep()
Correct Answer: A

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now