System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 157
Q3481:
Which of the following reduces concurrency in multithreaded environments?
A. Shared memory
B. Lock-free structures
C. Critical section locking
D. Thread pooling
Correct Answer:
C
Chapter: 157
Q3482:
What leads to serialization-like behavior in multithreaded applications?
A. Semaphore pooling
B. Multiple threads executing together
C. Single thread critical section execution
D. Heap fragmentation
Correct Answer:
C
Chapter: 157
Q3483:
What is the main performance cost of using synchronization mechanisms?
A. Memory overflow
B. Increased latency
C. Reduced interface speed
D. Thread termination
Correct Answer:
B
Chapter: 157
Q3484:
Why is locking considered costly in synchronization?
A. It requires pointer arithmetic
B. It creates deadlocks
C. It involves kernel operations
D. It allocates memory
Correct Answer:
C
Chapter: 158
Q3485:
Which synchronization construct showed almost the same performance as no synchronization?
A. Mutexes
B. Critical Section
C. Semaphore
D. Interlocked Functions
Correct Answer:
D
Chapter: 158
Q3486:
What is the main purpose of declspec(align) modifier?
A. Increase heap size
B. Align memory to minimize contention
C. Reduce thread count
D. Improve I/O speed
Correct Answer:
B
Chapter: 158
Q3487:
Which function is used to allocate memory with alignment?
A. malloc()
B. aligned_memory()
C. HeapAlloc()
D. align_malloc()
Correct Answer:
D
Chapter: 158
Q3488:
Which of the following deallocates aligned memory?
A. free()
B. memory_delete()
C. align_free()
D. release_block()
Correct Answer:
C
Chapter: 158
Q3489:
What is the main trade-off when enforcing synchronization?
A. More memory usage
B. Increased complexity
C. Performance impact
D. Lower CPU frequency
Correct Answer:
C
Chapter: 158
Q3490:
What synchronization mechanism showed the worst performance at high processor count?
A. Interlocked functions
B. Mutexes
C. Critical sections
D. Semaphores
Correct Answer:
B
Chapter: 158
Q3491:
Critical sections cost approximately ______ more than interlocked functions.
A. 10 times
B. 2 times
C. 4 times
D. Equal performance
Correct Answer:
B
Chapter: 158
Q3492:
Mutexes may cost ______ more than interlocked functions.
A. 1 to 5 times
B. 2 to 10 times
C. 2 to 30 times
D. 10 to 100 times
Correct Answer:
C
Chapter: 158
Q3493:
What happens to CS (Critical Section) performance as processor count increases?
A. It degrades
B. Remains constant
C. It improves
D. It fluctuates
Correct Answer:
C
Chapter: 158
Q3494:
Mutex performance ______ as processor count increases.
A. improves slightly
B. degrades rapidly
C. remains stable
D. increases exponentially
Correct Answer:
B
Chapter: 158
Q3495:
Which version of the program performed fastest overall?
A. NS (no sync)
B. CS (critical section)
C. MX (mutex)
D. IN (interlocked)
Correct Answer:
A
Chapter: 158
Q3496:
Which construct aligns memory to avoid cache conflict?
A. align_cache()
B. cache_avoid()
C. align_malloc()
D. declspec(align)
Correct Answer:
D
Chapter: 158
Q3497:
align_malloc() is used to ______.
A. create threads
B. lock variables
C. allocate aligned memory
D. assign CPU priority
Correct Answer:
C
Chapter: 158
Q3498:
What is measured in real time, user time, and system time?
A. Execution complexity
B. Memory footprint
C. Thread concurrency
D. Performance impact
Correct Answer:
D
Chapter: 158
Q3499:
Synchronization introduces ______ that affects performance.
A. thread creation
B. locking overhead
C. system shutdown
D. memory leaks
Correct Answer:
B
Chapter: 158
Q3500:
Which two implementations showed nearly equal timing?
A. NS and MX
B. IN and CS
C. NS and IN
D. MX and IN
Correct Answer:
C