Question: Thread Function The general flow of the findEvilNumbersCnt 1 ( ) and findEvilNumbersCnt 2 ( ) thread functions is as follows: Obtain the next block
Thread Function
The general flow of the findEvilNumbersCnt and findEvilNumbersCnt thread functions is as
follows:
Obtain the next block of numbers to check via global variable, currentIndex
increment the global counter by the block size
must be performed within a critical section ie locked and unlocked
While the next current number in the block is userLimit globally available;
Check if the number is a EvilOdious number
If the number is a Evil number, increment a local Evil number count
If the number is a Odious number, increment a local Odious number count
Update evilodious count as described below
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
