Skip to Main Content
C++ Concurrency in Action, Second Edition
book

C++ Concurrency in Action, Second Edition

by Anthony Williams
February 2019
Intermediate to advanced content levelIntermediate to advanced
592 pages
20h 37m
English
Manning Publications
Content preview from C++ Concurrency in Action, Second Edition

Chapter 2. Managing threads

This chapter covers

  • Starting threads, and various ways of specifying code to run on a new thread
  • Waiting for a thread to finish versus leaving it to run
  • Uniquely identifying threads

OK, so you’ve decided to use concurrency for your application. In particular, you’ve decided to use multiple threads. What now? How do you launch these threads, check that they’ve finished, and keep tabs on them? The C++ Standard Library makes most thread-management tasks relatively easy, with almost everything managed through the std::thread object associated with a given thread, as you’ll see. For those tasks that aren’t so straightforward, the library provides the flexibility to build what you need from the basic building blocks. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ Concurrency in Action

C++ Concurrency in Action

Anthony Williams
Programming Rust, 2nd Edition

Programming Rust, 2nd Edition

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall

Publisher Resources

ISBN: 9781617294693Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link