Question

I'am preparing for a competitive exam and i have an operating system question. I'am not getting how to solve it. please help me out.

Q-) A program took 160 seconds to execute on a single processor but only 64 seconds on a 4 core multicore. What is the best estimate for the execution time on a 64 core machine?

Was it helpful?

Solution

I don't think this is strictly relevant to programming (you might find this more relevant on the Math StackExchange but I'll attempt to answer it anyway.

The answer will depend entirely on how you model execution time vs number of cores. You could model the execution time as inversely proportional to the number of cores. For example, I used the following model:

Where t is time in seconds and n is number of cores, c (could represent overhead) and k (a factor) are constants.

Solve simultaneously

to get k = 128 and c = 32.

Then just substitute n = 64

So, you get 34 seconds according to this model. Of course, since you don't know the exact model, this can only be a calculated guess.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top