System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q3781: The WorkCallback function prototype contains the parameters Instance, Context, and _______.
- A: Work
- B: Thread
- C: Task
- D: Callback
View Answer
A
Q3782: The program reports an error and exits if memory allocation for work objects or arguments _______.
- A: fails
- B: succeeds
- C: is delayed
- D: is not aligned
View Answer
A
Q3783: In the Worker callback, threadArgs points to _______.
- A: struct THARG
- B: instance
- C: data
- D: lock
View Answer
A
Q3784: An alternate and simplistic technique for thread callbacks can omit _______.
- A: worker threads
- B: callback functions
- C: work items
- D: work queues
View Answer
C
Q3785: Which API is used to attempt submission of a thread pool callback without requiring work items?
- A: TrySubmitThreadPoolCallback
- B: CreateThreadpoolWork
- C: CreateThreadpoolCallback
- D: SubmitThreadpoolWork
View Answer
A
Q3786: The callback function type used in TrySubmitThreadPoolCallback is called _______.
- A: PTP_WORK_CALLBACK
- B: PTP_SIMPLE_CALLBACK
- C: PTP_COMPLEX_CALLBACK
- D: PTP_THREAD_CALLBACK
View Answer
B
Q3787: What is the correct signature for a simple callback function in thread pool APIs?
- A: VOID CALLBACK SimpleCallback(PTP_CALLBACK_INSTANCE, PVOID)
- B: VOID CALLBACK SimpleCallback(PVOID, PTP_CALLBACK_INSTANCE)
- C: INT SimpleCallback(PTP_CALLBACK_INSTANCE, PVOID)
- D: BOOL SimpleCallback(PTP_CALLBACK_INSTANCE, PVOID)
View Answer
A
Q3788: If work items are not required, which API is preferred for submitting thread pool callbacks?
- A: TrySubmitThreadPoolCallback
- B: CreateThreadpoolWork
- C: SubmitThreadpoolWork
- D: QueueUserWorkItem
View Answer
A
Q3789: The function CreateThreadpoolWork requires a callback function of type _______.
- A: PTP_SIMPLE_CALLBACK
- B: PTP_WORK_CALLBACK
- C: PTP_THREAD_CALLBACK
- D: PTP_CALLBACK_ENVIRON
View Answer
B
Q3790: In thread pool programming, the callback environment is passed as a parameter of type _______.
- A: PTP_WORK
- B: PTP_CALLBACK_ENVIRON
- C: PTP_SIMPLE_CALLBACK
- D: PTP_WORK_CALLBACK
View Answer
B