Search code examples
multithreadingparallel-processingcpumulticoresingle-threaded

Multi-thread process on multi-core or single-core double the speed?


Assume I have a process that consists of two ideally independent tasks (ideally, to remove the communication overhead). Would it be faster to do it on a single-core processor of 3GHz speed or two-core processor of 1.5GHz speed?

Of course, in case of two-core processor, the job is ideal for parallization. And for the single core, the two tasks will be time shared.

Update: questition in other words

A single-core processor of double the speed is always a better option than a two-core processor?


Solution

  • Ideally independent 2 tasks running on unideal OS like Windows 2012 will run faster on 2 cores at 1.5GHz, than on 1 core at 3GHz due to elimination of thread context switching overhead.

    Unfortunately, there are very very few ideally independent tasks.