Multi-threaded programming in C++
This book presents and illustrates the concept of multi-threaded programming discussing three main topics: (a) threads and synchronization primitives (Chapters 1-4); (b) common multi-threading techniques (Chapters 5-7): (c) more sophisticated designs (Chapters 8-10). While a ``thread may be seen as processing a single stream of t instructions, a multi-threaded (real) application contains many separate threads of execution, all running concurrently and each assigned to its particular task. Multi-threading and its object oriented programming are wonderful companions since C++ allows the basic building blocks for multi-threaded programming to be packaged as objects whilst multi-threading techniques can be applied to transform objects into active entities processing independently of the external code. Chapter 1 introduces the fundamental concepts of multi-threaded programming in C++ and covers the following topics: single-threaded and multi-threaded programming; thread synchronization primitives; objects and classes in C++; multi-threading under UNLX and Windows. Chapter 2 (Threads) explains thread scheduling and thread environment in more detail: time-slicing and the scheduler; shared process environment; the THREAD class. Chapter 3 (Mutexes) defines the ``mutex (mutual exclusion) synchronization primitive used to arbitrate amongst a number of threads all competing for the same resource. There are described: the MUTEX class; atomic operations; inter-thread communication; state transitions and snapshots; the ATOMIC class; implementation details for UNIX and Windows. Chapter 4 (Events) presents the ``event synchronization primitive used to coordinate a collection of cooperating threads. The key issues covered are: automatic and manual events; the EVENT class; the `producer-consumer' paradigm; the TIC-TAC-TOE class showing how to schedule a background thread to perform lengthy computation and leaving the foreground thread response for user hit interaction; UNIX and Windows implementations. Chapter 5 (Semaphores) supports semaphores as a more general pattern of thread synchronization. There are discussed: context parameters; the SYNCH class; the SEMAPHORE class; the POOL class; transferring information between threads; the PIPELINE class; the ARBITRATOR class; implementation details in UNIX and Windows. Chapter 6 (Objects) examines different patterns of the execution flow that are possible with passive object paradigms. Various implementations of TRANSFER, MUX, and DEMUX classes illustrate the techniques involved in creating passive and active classes. Chapter 7 (Keys) introduces the ``key notion as an alternative to parameters for passing thread-specific data from one function to another. There are also discussed: thread-specific storage; the KEY class; one-time initialization; the ONCE class; using keys to implement thread identifiers for the THREAD class. Chapter 8 (Multiple Mutexes) considers the problem of deadlock and the techniques to avoid it. The main issues of the chapter are: common causes of deadlock; resource acquisition diagrams; methods of avoiding deadlock; the RECURSIVE-MUTEX class. TIMER and CLOCK classes describe the deadlock avoidance techniques. Chapter 9 (Multiple Events) shows how to deal with: overlapping event sets; random event monitoring; the MULTI-EVENT class; implementations for UNIX and Windows. The final Chapter 10 (Distributed Computing) develops an extended example of multi-thread programming in C++. A reasonable simple ``distributed database illustrates: network communications; packets and streams; the CHANNEL class; the STREAM class; relational databases; the QUERY class; DATABASE class. The book addresses a large variety of users and designers interested in the development of new techniques for distributed programming.
- Generic locking and deadlock-prevention with C++
- scientific article; zbMATH DE number 1156311 (Why is no real title available?)
- scientific article; zbMATH DE number 1979570 (Why is no real title available?)
- scientific article; zbMATH DE number 804272 (Why is no real title available?)
- scientific article; zbMATH DE number 804375 (Why is no real title available?)
- scientific article; zbMATH DE number 964523 (Why is no real title available?)
This page was built for publication: Multi-threaded programming in C++
Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q4267977)