Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

7. How might you go about testing these assumptions?

Answered: 1 week ago