Global Superstore 7
Prerequisite: You wrote the solution for part 6.
Goal: use Atomic
to synchronize multi-threaded updates to a variable.
Task 1
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
Final Remarks:
When possible, favor Atomic
types over locks. When several threads are updating a variable, Atomic
ensures the updates are synchronized.
Good Luck!
Feedback Summary
4.7
43 students
5
91%
4
2%
3
0%
2
0%
1
7%
Written Reviews
There are no written reviews yet.