Exam 2026/2027 Exam
Questions and Correct
Answers | New Update
A data race cannot happen in a single-threaded environment -
ANSWER ✔✔True
Two threads can simultaneously hold a mutual-exclusion (mutex) lock -
ANSWER ✔✔False
The reason behind why mutex locks address data race problems is that
only a single thread is allowed to acquire the lock, and all other threads
wait for 3 seconds. - ANSWER ✔✔False
, Imagine you have a single variable (object) that you want to change from
0 to 1 atomically (no data races). You cannot use a test-and-swap
instruction to achieve this. - ANSWER ✔✔False
One reason why inconsistent lock usage leads to data races is because
developers may use different locks to access an object. - ANSWER
✔✔True
A deadlock cannot occur in a single core system. - ANSWER
✔✔False
A spinlock is an efficient way to ensure atomicity in long-running code. -
ANSWER ✔✔False
Using a mutex lock hurts the performance of the system because it
makes computations run sequentially instead of in parallel. -
ANSWER ✔✔True
Which of the following are the three typical device registers?
I. Status, command, sync
II. Data, command, info
III. Status, command, data
IV. Status, command, data. - ANSWER ✔✔III. Status, command, data