0
$\begingroup$

Speed up of execution of a program is to be calculated within a multi-threading rather than a single thread system. The program's 30% instruction can be executed serially & rest can be executed concurrently.The processor has 4 cores.

$\endgroup$
  • 1
    $\begingroup$ What have you tried? Any ideas? $\endgroup$ – vonbrand Aug 8 at 19:42
  • $\begingroup$ How does the clock rate change if multiple threads are run in parallel? Do you have enough cache to run 4 threads efficiently? $\endgroup$ – gnasher729 Aug 8 at 22:07
  • $\begingroup$ I thought maybe the speedup concept from pipeline might work...but nah....there are entities like tasks, no. of stages... $\endgroup$ – Dipsankar Maity Aug 9 at 0:51
0
$\begingroup$

Say you have 100 units of work. 30 units are such that only one core can be used while performing that unit of work. 70 units are such that four cores each can perform one unit of work at the same time. That should be enough to give a theoretical answer.

But the question is imprecise: can the “serial “ task be in in parallel with three “parallel” tasks? In that case, you take just 30 units, otherwise 55 units.

In practice, there are problems. Using four cores produces heat which forces a reduction in clock speed. You may have four cores, but only one memory subsystem. So four cores hammering the memory will NOT do four times as much work. A single core may be able to use all available cache memory, which would have to be shared if four cores are running, reducing speed.

What makes it more interesting is the fact that sometimes you find an algorithm A which cannot be parallelised, and an algorithm B which takes more steps than A, but can be parallelised. So choosing algorithm B may save time overall, but do more work.

The only way to get a correct answer is to measure it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.