Does multi-threading improve performance? How?

For a simple task of iterating 100 elements multi-threading the task will not provide a performance benefit.

Iterating over 100 billion elements and do processing on each element, then the use of additional CPU’s may well help reduce processing time. And more complicated tasks will likely incur interrupts due to I/O for example. When one thread is sleeping waiting for a peripheral to complete I/O (e.g. a disk write, or a key press from the keyboard), other threads can continue their work.

Leave a Comment