Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 169
Q3741:
Synchronization in thread pool callback functions is still necessary because multiple threads may _______.
A. access shared resources
B. run simultaneously
C. wait indefinitely
D. be created repeatedly
Correct Answer: A
Chapter: 170
Q3742:
Callbacks are an efficient alternative to _______.
A. threading
B. memory allocation
C. file I/O
D. database queries
Correct Answer: A
Chapter: 170
Q3743:
Basic Windows programming uses _______ functions primitively to simulate threading.
A. callback
B. pointers
C. loops
D. variables
Correct Answer: A
Chapter: 170
Q3744:
The header file included for this thread pool example is _______.
A. Everything.h
B. Windows.h
C. Threadpool.h
D. Process.h
Correct Answer: A
Chapter: 170
Q3745:
The macro DELAY_COUNT is set to _______.
A. 20
B. 64
C. 10
D. 5
Correct Answer: A
Chapter: 170
Q3746:
The CACHE_LINE_SIZE is defined as _______.
A. 64
B. 20
C. 32
D. 128
Correct Answer: A
Chapter: 170
Q3747:
In the program, nThread represents the number of _______.
A. worker threads
B. tasks
C. cpu cores
D. memory blocks
Correct Answer: A
Chapter: 170
Q3748:
tasksPerThread refers to the number of _______ assigned to each thread.
A. work units
B. memory blocks
C. locks
D. processes
Correct Answer: A
Chapter: 170
Q3749:
The SRWLOCK slimRWL is used to manage _______.
A. thread synchronization
B. thread creation
C. memory allocation
D. thread termination
Correct Answer: A
Chapter: 170
Q3750:
The THARG struct contains the member _______ to track tasks completed.
A. tasksComplete
B. tasksToComplete
C. objectNumber
D. slimRWL
Correct Answer: A
Chapter: 170
Q3751:
The function InitializeSRWLock initializes a _______.
A. slimg reader-writer lock
B. mutex
C. thread pool
D. callback environment
Correct Answer: A
Chapter: 170
Q3752:
The pWorkObjects array stores references to _______.
A. work objects
B. callback instances
C. thread IDs
D. thread handles
Correct Answer: A
Chapter: 170
Q3753:
Memory for pWorkObjects is allocated using _______.
A. malloc
B. calloc
C. realloc
D. alloc
Correct Answer: A
Chapter: 170
Q3754:
If pWorkObjects or pWorkObjArgsArray is NULL, the program _______.
A. Reports an error
B. Continues silently
C. Allocates memory again
D. Terminates threads
Correct Answer: A
Chapter: 170
Q3755:
The API CreateThreadpoolWork returns a _______.
A. work object
B. thread handle
C. thread ID
D. callback instance
Correct Answer: A
Chapter: 170
Q3756:
SubmitThreadpoolWork is called to _______.
A. Register the work object
B. Execute the callback function
C. Wait for threads to complete
D. Destroy the thread pool
Correct Answer: A
Chapter: 170
Q3757:
WaitForThreadpoolWorkCallbacks waits until _______.
A. All callback functions return
B. One callback completes
C. A timeout occurs
D. Memory is freed
Correct Answer: A
Chapter: 170
Q3758:
In the Worker callback function, the parameter Context points to _______.
A. Thread arguments
B. Callback instance
C. Work object
D. Current thread ID
Correct Answer: A
Chapter: 170
Q3759:
AcquireSRWLockExclusive is used to _______.
A. Lock for exclusive access
B. Release the lock
C. Initialize lock
D. Destroy lock
Correct Answer: A
Chapter: 170
Q3760:
ReleaseSRWLockExclusive is used to _______.
A. Release exclusive lock
B. Acquire exclusive lock
C. Destroy lock
D. Initialize lock
Correct Answer: A

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now