Multiple Thread Programming
Modern programming environments allow you to program with multiple threads. Threads run inside of processes and allow multiple concurrent execution paths. If there are multiple CPUs, you can achieve parallel processing through the use of threads. On a single processor machine, you can often achieve greater efficiency by using multiple threads, because when one thread is blocked, for example, waiting on an I/O completion, another thread can continue execution. Also, the use of multiple threads can make a program more responsive to shorter tasks, such as tasks requiring user responses.
Along with the potential benefit of programming with multiple threads, there is greater program complexity, because you have to manage ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access