Concurrent Programming

These days it’s easier to improve computer performance by adding processors than it is to increase processor speed. So computers with dual-core or quad-core processors or even with multiple multicore processors are the norm. This enables computers to run multiple threads of execution simultaneously. One processor might handle a video download while another processor handles your spreadsheet.

Some activities can benefit from multiple threads, whereas others don’t. Consider searching for something in a singly linked list. A program has to start at the beginning and follow the links, in order, to the end of the list; there’s nothing much a second thread could do to help. Now consider an unsorted array. Using the random access ...

Get C++ Primer Plus 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.