Daniele Bochicchio, Stefano Mostarda, and Marco De Sanctis are
authors of ASP.NET 4.0 in Practice. With so many multicore CPUs
on the market, multithreading and parallel execution are
becoming more popular topics among developers. Both
multithreading and parallel execution aim at reducing computing
time, providing better performance. Multithreading is the
ability to execute multiple tasks at the same time using
different threads (see Figure 1). Parallel execution is the
ability to span a single task across multiple CPUs and use the
whole power to execute a computing task in the fastest possible
way. Process, Threads, and Execution When a program is executed,
the operating system creates a particular object called process,
giving an isolated memory space to it. A process contains a
specific kind of items called threads, used to execute the code.
A process, in fact, does not have the ability to execute
anything. A process contains at least one thread (the primary
one). When the primary thread is terminated, the