Question: I need this in java program 2 will implement a difference approach to multi thread prime counting. the thread will call a method called getWork.

I need this in java

program 2 will implement a difference approach to multi thread prime counting. the thread will call a method called getWork. This method will return an interval over which to count the number of primes. We refer to this bit of work as a bite. The interval should be small enough to allow for a good load balancing, but large enough so that threads are not calling the getWork method constantly. The driver should be responsible for reporting the amount of time it takes to complete the whole job, and the total count of prime over the entire work rang. It should give following 1.Number of threads 2.Number of primes computed by each thread 3.Time used by each thread 4.Total number of primes 5.Total time used by the driver 6.Number of bites processed by each thread 7.Speedup

The Program Results

-------------------

THREAD-1: PRIMECOUNT: 91121 TIMER: 1.719127 sec TOTAL BITES: 54

THREAD-2: PRIMECOUNT: 73605 TIMER: 1.713799 sec TOTAL BITES: 45

THREAD-3: PRIMECOUNT: 83974 TIMER: 1.714943 sec TOTAL BITES: 51

THREAD-4: PRIMECOUNT: 97170 TIMER: 1.721303 sec TOTAL BITES: 58

THREAD-5: PRIMECOUNT: 74658 TIMER: 1.688700 sec TOTAL BITES: 45

THREAD-6: PRIMECOUNT: 84127 TIMER: 1.719229 sec TOTAL BITES: 51

THREAD-7: PRIMECOUNT: 78419 TIMER: 1.722470 sec TOTAL BITES: 47

THREAD-8: PRIMECOUNT: 81504 TIMER: 1.678458 sec TOTAL BITES: 49

RANGE: 10,000,000 BITE SIZE = 25,000

TOTAL PRIMES: 664,578

TOTAL THREAD TIME: 13.678028 sec

RUNNING TIME: 1.760415 sec

SPEEDUP: 7.77

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!