Speeding a Program's Execution using Threads

The formula of Amdahl's Law is:

$$ {Speedup = \frac{1}{(1-p)+\frac{p}{n}}.} $$

In the above equation, $ {p} $ is the portion of the program that runs in parallel (a number from 0 to 1,) and $ {n} $ is the number of available CPUs in the device (integer greater or equal to 1.)

That is, to calculate the maximum possible speedup, you need to know (1) what chunk of the program will be run by threads on multiple CPUs, and (2) how many CPUs the computer has. Then, just plug-in the quantities to find the actual speedup.