.. _ThreadsOverview: .. raw:: html .. |--| unicode:: U+2013 .. en dash .. |---| unicode:: U+2014 .. em dash, trimming surrounding whitespace :trim: .. This file is part of the OpenCSF eTextbook project. It was .. auto-generated by scripts from the OpenDSA eTextbook project. .. See https://OpenCSF.org for more details. OpenCSF is distributed .. under a Creative Commons Attribution-NonCommercial 4.0 International .. License (see http://creativecommons.org/licenses/by-nc/4.0/), .. Copyright (c) 2019-2021 by Michael S. Kirkpatrick. OpenDSA is .. distributed under an MIT open source license, Copyright (c) 2012-2021 .. by the OpenDSA Project Contributors. .. avmetadata:: :author: Michael S. Kirkpatrick :requires: :satisfies: Multithreading Introduction :topic: Multithreading Concurrency with Multithreading =============================== .. figure:: Images/CSF-Timeline.6.png :align: center :width: 90% :figwidth: 100% :alt: Timeline of major CSF topics with Multicore and Threads highlighted .. raw:: html
Plus ça change, plus c'est la même chose. Or put another way, everything old is new again. IBM OS/360 introduced threads in 1967. The 1990s brought renewed interest in threads, with POSIX.1c-1995 standardizing their interface. One key factor behind this interest was the development of Linux as an open-source platform for cluster systems. Another factor was the impact of the “power wall” on Moore's law and integrated circuit design. As a result of this resurgence, threads are now unavoidable as a core abstraction in modern computing. .. topic:: Chapter Objectives .. figure:: Images/CSF-Images-Objectives.png :align: left :figwidth: 5% :width: 100% :alt: Decorative chapter objectives image In this chapter, we will address the following instructional objectives: * We will compare and contrast the concepts of threads and processes, describing the advantages and limitations of each. * We will examine code using the POSIX thread library, a library that is widely available on a variety of platforms. * We will explore race conditions as a new source of bugs that arise in multithreaded software. * We will consider the benefits and drawbacks of using implicit threading libraries and built-in language support. Throughout the first part of this book, we referred to processes whenever we were discussing a unit of execution. Specifically, in `Processes and Multiprogramming“The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.”