This material is part of the course Practical Introduction to Parallel Programming and meant for educational purposes only.
Task
Write a program that generates a sequence of random numbers between \(0\) and \(N\) and counts how many times the integer part of that number equals \(0, 1, \dots, N\). This process is known as generating a histogram.
Implement two version, one with atomic
the other with critical section
, and compare the performance of both implementations for different \(N\) and a large number of sampling points.