System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 170
Q3761:
The worker thread increments tasksComplete while holding the _______.
A. Exclusive SRW lock
B. Mutex
C. Spin lock
D. Semaphore
Correct Answer:
A
Chapter: 170
Q3762:
The delay_cpu function simulates a delay by _______.
A. Pausing CPU cycles
B. Allocating memory
C. Terminating thread
D. Creating a new thread
Correct Answer:
A
Chapter: 170
Q3763:
traceFlag controls whether _______ are printed during execution.
A. debug messages
B. error messages
C. thread IDs
D. task completion status
Correct Answer:
A
Chapter: 170
Q3764:
Worker threads terminate after completing _______.
A. All assigned tasks
B. A set time interval
C. A fixed CPU usage
D. A fixed number of threads
Correct Answer:
A
Chapter: 170
Q3765:
The _aligned_malloc function is used to allocate memory aligned to _______.
A. cache line size
B. page size
C. thread size
D. stack size
Correct Answer:
A
Chapter: 170
Q3766:
Closing the thread pool work object is done using _______.
A. CloseThreadpoolWork
B. DestroyThreadpool
C. FreeThreadpool
D. CloseThreadpool
Correct Answer:
A
Chapter: 170
Q3767:
Freeing the memory allocated for thread arguments uses _______.
A. _aligned_free
B. free
C. malloc
D. realloc
Correct Answer:
A
Chapter: 170
Q3768:
The function _tprintf is used for _______.
A. Formatted console output
B. Memory allocation
C. Thread creation
D. Lock initialization
Correct Answer:
A
Chapter: 170
Q3769:
The objectNumber in THARG identifies the _______.
A. Thread index
B. CPU core number
C. Work unit
D. Lock ID
Correct Answer:
A
Chapter: 170
Q3770:
The program takes the number of threads and tasks as _______.
A. command line arguments
B. hardcoded variables
C. user input
D. function parameters
Correct Answer:
A
Chapter: 170
Q3771:
If the program is run with fewer than 3 arguments, it _______.
A. Displays usage instructions
B. Starts with default values
C. Exits silently
D. Starts with one thread
Correct Answer:
A
Chapter: 170
Q3772:
The loop in Worker runs while tasksComplete is _______ tasksToComplete.
A. less than
B. greater than
C. equal to
D. not equal to
Correct Answer:
A
Chapter: 170
Q3773:
traceFlag is set to TRUE if the _______ argument is provided.
A. Fourth
B. Fifth
C. Second
D. Third
Correct Answer:
B
Chapter: 170
Q3774:
Using thread pools helps avoid explicit thread _______.
A. management
B. creation
C. destroying
D. communication
Correct Answer:
A
Chapter: 170
Q3775:
The type THARG contains a slim reader-writer lock called _______.
A. slimRWL
B. srwLock
C. srwlock
D. SLWlock
Correct Answer:
A
Chapter: 170
Q3776:
The macro CACHE_LINE_SIZE ensures memory allocation aligns with the size of a _______.
A. cache line
B. cache block
C. page
D. thread stack
Correct Answer:
A
Chapter: 170
Q3777:
In the thread pool framework, the work object is of type _______.
A. PTP_WORK
B. PTP_THREAD
C. PVOID
D. PTP_CALLBACK
Correct Answer:
A
Chapter: 170
Q3778:
Worker threads report progress in a(n) _______ array.
A. unshared
B. shared
C. global
D. local
Correct Answer:
A
Chapter: 170
Q3779:
The main function uses _______ to parse command line arguments into integers.
A. _ttoi
B. atoi
C. strtol
D. scanf
Correct Answer:
A
Chapter: 170
Q3780:
The traceFlag variable is of type _______.
A. BOOL
B. int
C. char
D. float
Correct Answer:
A