17.1. Multi-threading

For those who need a quick reminder – a multi-processing operating system is one that can, apparently, execute more than one process simultaneously. Each process in turn can have multiple threads running at the same time. The term 'multitasking' generally means running many tasks concurrently, and can be used for both multi-processing (also known as 'process-based multitasking') and multi-threading (also known as 'thread-based multitasking').

If a computer has only one CPU, we are talking about only one real processing sequence. Hence, any multi-processing on a single-CPU machine is 'apparent' only. Each CPU can only run one statement at a time, but it is switching between the different concurrent processes very quickly ...

Get From Java to C#: A Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.