Daily iOS
ConcurrencyNetEase

Lock-free increment range

Five threads each run count += 1 20 times on a shared variable count (initially 0), with no lock. When they've all finished, what range of values can count have? (Assume the increment is three steps, read, add, write, and another thread can cut in between any two steps.)

Pick one

Submit