Multithreaded Programming with C++

A professional C++ programmer needs to know how to write correct multithreaded code to take full advantage of all the available processor units. Writing multithreaded applications used to rely on platform‐ and operating system‐specific APIs. This made it difficult to write platform‐independent multi...

Full description

Saved in:
Bibliographic Details
Published in:Professional C++ pp. 1 - 2
Main Author: Gregoire, Marc
Format: Book Chapter
Language:English
Published: Hoboken, New Jersey John Wiley & Sons 2018
John Wiley & Sons, Inc
Edition:4th Edition
Subjects:
ISBN:1119421306, 9781119421306
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:A professional C++ programmer needs to know how to write correct multithreaded code to take full advantage of all the available processor units. Writing multithreaded applications used to rely on platform‐ and operating system‐specific APIs. This made it difficult to write platform‐independent multithreaded code. C++11 solved this problem by including a standard threading library. A difficult part of multithreaded programming is making the algorithm parallel, which is highly dependent on the type of the algorithm. Other difficulties are preventing race conditions, deadlocks, tearing, and false‐sharing. This chapter discusses these difficulties in more detail. They are usually solved using atomics or explicit synchronization mechanisms. Launching a new thread is pretty easy. However, in most cases the programmers are probably interested in results produced by the thread. There is one easier method to obtain a result from threads: futures.
ISBN:1119421306
9781119421306
DOI:10.1002/9781119421276.ch23