System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 160
Q3541:
False sharing leads to ______ access of elements in the array.
A. parallel
B. independent
C. random
D. serial
Correct Answer:
D
Chapter: 160
Q3542:
The alignment of each variable to its own cache line is a solution to ______.
A. cache overflow
B. cache coherence
C. false sharing
D. contention management
Correct Answer:
C
Chapter: 160
Q3543:
When variables share the same address line across different threads, ______ can occur.
A. thread blocking
B. false sharing
C. data loss
D. cache hit
Correct Answer:
B
Chapter: 160
Q3544:
False sharing results in ______ performance.
A. improved
B. stable
C. degraded
D. unaffected
Correct Answer:
C
Chapter: 160
Q3545:
False sharing can be minimized by ______.
A. overclocking the CPU
B. sharing memory addresses
C. duplicating variables
D. using padding or alignment
Correct Answer:
D
Chapter: 160
Q3546:
What happens if two threads modify variables on the same cache line?
A. Only the first thread can proceed
B. Both threads are blocked
C. False sharing occurs
D. System locks down
Correct Answer:
C
Chapter: 160
Q3547:
One major drawback of cache line alignment is ______.
A. reduced speed
B. increased memory usage
C. complex code syntax
D. thread count reduction
Correct Answer:
B
Chapter: 160
Q3548:
When a cache line is locked, other elements on the same line are accessed ______.
A. simultaneously
B. in parallel
C. serially
D. concurrently
Correct Answer:
C
Chapter: 160
Q3549:
False sharing mainly affects systems using ______.
A. HDD storage
B. GPU cache
C. CPU cache
D. Optical drives
Correct Answer:
C
Chapter: 160
Q3550:
Variables placed on the same cache line by different threads may cause ______.
A. cache miss
B. thread starvation
C. false sharing
D. thread collision
Correct Answer:
C
Chapter: 160
Q3551:
In false sharing contention, a change in one variable will lock the ______.
A. thread
B. address only
C. entire cache line
D. registers
Correct Answer:
C
Chapter: 160
Q3552:
Which of the following is a direct solution to false sharing?
A. Cache flushing
B. Multithreading
C. Variable alignment
D. Buffer pooling
Correct Answer:
C
Chapter: 160
Q3553:
False sharing can occur when threads ______.
A. share registers
B. write to different cache lines
C. access variables on the same cache line
D. read from disk
Correct Answer:
C
Chapter: 160
Q3554:
False sharing is less of an issue when each thread works with ______.
A. shared memory
B. separate cache lines
C. same cache
D. single core
Correct Answer:
B
Chapter: 160
Q3555:
To avoid false sharing, variables should be aligned ______.
A. in the same thread
B. randomly
C. separately
D. per processor
Correct Answer:
C
Chapter: 161
Q3556:
What is used to optimize the overhead of Critical Sections?
A. Thread pool
B. Spin count
C. Mutex recursion
D. Process priority
Correct Answer:
B
Chapter: 161
Q3557:
Critical Section operates in ______.
A. kernel space
B. user space
C. system cache
D. shared memory
Correct Answer:
B
Chapter: 161
Q3558:
Which function is used to enter a Critical Section?
A. EnterThread()
B. WaitForLock()
C. EnterCriticalSection()
D. WaitObject()
Correct Answer:
C
Chapter: 161
Q3559:
Mutexes require ______ for locking and unlocking.
A. hardware interrupts
B. system calls
C. cache coherence
D. thread duplication
Correct Answer:
B
Chapter: 161
Q3560:
The lock bit is set when ______.
A. thread priority increases
B. thread finishes
C. another thread enters
D. EnterCriticalSection() is called
Correct Answer:
D