Practice · 4 of 4
Race or Not?
CHALLENGE
Difficulty: advanced+25 XP
Implement const char *race_verdict(int kind): 0 two threads write a plain int without locks → "race", 1 two threads read a const table → "not-a-race", 2 one thread writes while another reads a plain int → "race", 3 both threads update different mutex-protected counters → "not-a-race", 4 two threads write distinct elements of an array → "not-a-race" (distinct memory objects).
Press Submit to check your solution.
Back to lesson: Practice: Detection Drills