Question: Part B Now we extend the Part A so that you generates random points and determines if the points fall within the circle. Each thread
Part B Now we extend the Part A so that you generates random points and determines if the points fall within the circle. Each thread will have to update the global count of all points that fall within the circle. Protect against race conditions on updates to the shared global variable by using mutex locks. The number of created threads will be provided from the command line. Perform necessary error checking to ensure that a positive integer is passed on the command line. The total number of points generated by all the created threads should be no less than 50,000,000. Following are some running examples, assuming the compiled program named b.out: create several threads, each of which ./b.out Usage: .b.out
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
