Practice · 1 of 4
The Contended Account
CHALLENGE
Difficulty: advanced+25 XP
Given a mutex and a global long long account (both in your editor). Implement void deposit(long long amount) — add amount to account under the mutex — and long long balance(void) returning it. The grader hammers it from many threads; a lost update means a lost test.
Press Submit to check your solution.
Back to lesson: Practice: Synchronization Drills