Global Superstore 7
Prerequisite: You wrote the solution for part 6.
Atomic to synchronize multi-threaded updates to a variable.
Locks can make your code hard to read. Use atomic variables to enforce thread safety. Your final output should remain:
>>: The sample size is: 1522889
>>: The quantity sold is: 8818065
When possible, favor
Atomic types over locks. When several threads are updating a variable,
Atomic ensures the updates are synchronized.