C Concurrency in Action 2nd Edition Anthony Williams instant download
C Concurrency in Action 2nd Edition Anthony Williams instant download
Williams download
https://ebookultra.com/download/c-concurrency-in-action-2nd-
edition-anthony-williams/
https://ebookultra.com/download/concurrency-in-c-cookbook-1st-edition-
stephen-cleary/
https://ebookultra.com/download/c-cli-in-action-1st-edition-nishant-
sivakumar/
https://ebookultra.com/download/fun-with-action-rhymes-and-poems-1st-
edition-brenda-williams/
https://ebookultra.com/download/flying-guns-of-world-war-i-first-
edition-anthony-g-williams/
C 141 Starlifter in Action 1st Edition John Burford
https://ebookultra.com/download/c-141-starlifter-in-action-1st-
edition-john-burford/
https://ebookultra.com/download/music-therapy-in-action-2nd-edition-
mary-priestley/
https://ebookultra.com/download/postgis-in-action-2nd-edition-regina-
o-obe/
https://ebookultra.com/download/action-contemplation-and-happiness-an-
essay-on-aristotle-c-d-c-reeve/
https://ebookultra.com/download/cryptography-in-c-c-2nd-edition-
michael-welschenbach/
C Concurrency in Action 2nd Edition Anthony Williams
Digital Instant Download
Author(s): Anthony Williams
ISBN(s): 9781617294693, 1617294691
Edition: 2
File Details: PDF, 6.46 MB
Year: 2019
Language: english
IN ACTION
SECOND EDITION
Anthony Williams
MANNING
https://avxhm.se/blogs/hill0
Praise for the first edition
“It’s not just the best current treatment of C++11’s threading facilities ... it’s likely to
remain the best for some time to come.”
—Scott Meyers, author of Effective C++ and More Effective C++
“A thoughtful, in-depth guide to the new concurrency standard for C++ straight from
the mouth of one the horses.”
—Neil Horlock, Director, Credit Suisse
“Any serious C++ developers should understand the contents of this important book.”
—Dr. Jamie Allsop, Development Director
https://avxhm.se/blogs/hill0
https://avxhm.se/blogs/hill0
C++ Concurrency
in Action
Second Edition
ANTHONY WILLIAMS
MANNING
SHELTER ISLAND
https://avxhm.se/blogs/hill0
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: [email protected]
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial caps
or all caps.
Recognizing the importance of preserving what has been written, it is Manning’s policy to have
the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books
are printed on paper that is at least 15 percent recycled and processed without the use of
elemental chlorine.
ISBN: 9781617294693
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 – SP – 24 23 22 21 20 19
https://avxhm.se/blogs/hill0
To Kim, Hugh, and Erin
https://avxhm.se/blogs/hill0
brief contents
1 ■ Hello, world of concurrency in C++! 1
2 ■ Managing threads 16
3 ■ Sharing data between threads 36
4 ■ Synchronizing concurrent operations 72
5 ■ The C++ memory model and operations on
atomic types 124
6 ■ Designing lock-based concurrent data structures 173
7 ■ Designing lock-free concurrent data structures 205
8 ■ Designing concurrent code 251
9 ■ Advanced thread management 300
10 ■ Parallel algorithms 327
11 ■ Testing and debugging multithreaded applications 339
vi
https://avxhm.se/blogs/hill0
contents
preface xiii
acknowledgments xv
about this book xvii
about the author xx
about the cover illustration xxi
vii
https://avxhm.se/blogs/hill0
viii CONTENTS
2 Managing threads 16
2.1 Basic thread management 17
Launching a thread 17 Waiting for a thread to complete 20
■
the background 22
2.2 Passing arguments to a thread function 24
2.3 Transferring ownership of a thread 27
2.4 Choosing the number of threads at runtime 31
2.5 Identifying threads 34
https://avxhm.se/blogs/hill0
CONTENTS ix
https://avxhm.se/blogs/hill0
x CONTENTS
switching 266
https://avxhm.se/blogs/hill0
CONTENTS xi
std::partial_sum 290
https://avxhm.se/blogs/hill0
xii CONTENTS
https://avxhm.se/blogs/hill0
preface
I encountered the concept of multithreaded code while working at my first job after I
left college. We were writing a data processing application that had to populate a data-
base with incoming data records. There was a lot of data, but each record was inde-
pendent and required a reasonable amount of processing before it could be inserted
into the database. To take full advantage of the power of our 10-CPU UltraSPARC, we
ran the code in multiple threads, each thread processing its own set of incoming
records. We wrote the code in C++, using POSIX threads, and made a fair number of
mistakes—multithreading was new to all of us—but we got there in the end. It was also
while working on this project that I first became aware of the C++ Standards Commit-
tee and the freshly published C++ Standard.
I have had a keen interest in multithreading and concurrency ever since. Where
others saw it as difficult, complex, and a source of problems, I saw it as a powerful tool
that could enable your code to take advantage of the available hardware to run faster.
Later on, I would learn how it could be used to improve the responsiveness and per-
formance of applications even on single-core hardware, by using multiple threads to
hide the latency of time-consuming operations such as I/O. I also learned how it
worked at the OS level and how Intel CPUs handled task switching.
Meanwhile, my interest in C++ brought me in contact with the ACCU and then the
C++ Standards panel at BSI, as well as Boost. I followed the initial development of the
Boost Thread Library with interest, and when it was abandoned by the original devel-
oper, I jumped at the chance to get involved. I was the primary developer and main-
tainer of the Boost Thread Library for a number of years, though I have since handed
that responsibility on.
xiii
https://avxhm.se/blogs/hill0
xiv PREFACE
As the work of the C++ Standards Committee shifted from fixing defects in the
existing standard to writing proposals for the C++11 standard (named C++0x in the
hope that it would be finished by 2009, and then officially C++11, because it was finally
published in 2011), I got more involved with BSI and started drafting proposals of my
own. Once it became clear that multithreading was on the agenda, I jumped in with
both feet and authored or co-authored many of the multithreading and concurrency-
related proposals that shaped this part of the standard. I have continued to be
involved with the concurrency group as we worked on the changes for C++17, the
Concurrency TS, and proposals for the future. I feel privileged to have had the oppor-
tunity to combine two of my major computer-related interests—C++ and multithread-
ing—in this way.
This book draws on all my experience with both C++ and multithreading and aims
to teach other C++ developers how to use the C++17 Thread Library and Concurrency
TS safely and efficiently. I also hope to impart some of my enthusiasm for the subject
along the way.
https://avxhm.se/blogs/hill0
Random documents with unrelated
content Scribd suggests to you:
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com