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...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Professional C++ S. 1 - 2
1. Verfasser: Gregoire, Marc
Format: Buchkapitel
Sprache:Englisch
Veröffentlicht: Hoboken, New Jersey John Wiley & Sons 2018
John Wiley & Sons, Inc
Ausgabe:4th Edition
Schlagworte:
ISBN:1119421306, 9781119421306
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung: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