S4 Computer architecture · Practice
Memory consistency and synchronization
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
0 solved
0 in a row
0 of 8 kinds solid
Check
8 cores contend for a test-and-test-and-set lock, one holding it and the rest waiting. Each release makes every waiting core miss twice, and one fewer waits after each handoff. How many transactions until all have held it?
Check
The same 32 cores use a ticket lock, where each release costs one miss per waiting core. How many transactions until all have held it?
Check
Every thread spends 0.04 of its time holding one shared lock. At most how many threads' worth of throughput can the program reach?
Check
A tree barrier with fan-in 2 gathers 1000 threads, taking 60 ns per level. How long does the arrival phase take?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
Check
Threads spend 0.05 of their time in one critical section; a barrier joins 64 threads.
(a)
What is the most throughput, in threads' worth, the lock allows?
(b)
How long does a tree barrier with fan-in 8 take, at 50 ns per level?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
(c)
And a centralized counter at 50 ns per atomic?
Check
Test-and-test-and-set transactions for 8 cores?
Check
Throughput limit with 0.04 in one critical section?
Check
Tree barrier: 256 threads, fan-in 4, 80 ns per level?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in S4