GithubHelp home page GithubHelp logo

davestrickland / mastering-cpp-multithreading Goto Github PK

View Code? Open in Web Editor NEW

This project forked from packtpublishing/mastering-cpp-multithreading

0.0 0.0 0.0 180 KB

License: MIT License

C++ 86.28% C 3.21% Makefile 10.51%

mastering-cpp-multithreading's Introduction

Mastering C++ Multithreading

This is the code repository for Mastering C++ Multithreading, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

About the Book

Multithreaded applications execute multiple threads in a single processor environment, allowing developers achieve concurrency. This book will teach you the finer points of multithreading and concurrency concepts and how to apply them efficiently in C++.

Instructions and Navigation

All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.

The code will look like the following:

cout_mtx.lock();
cout << "Thread " << tid << " adding " << rval << ". New value: " << val
<< ".\n";
cout_mtx.unlock();
values_mtx.lock();
values.push_back(val);
values_mtx.unlock();
}

To follow the instructions in this book, you will need any OS (Windows, Linux, or macOS) and any C++ compiler installed on your systems.

Example Code

From the github repository the code examples are as follows. Note that a lot of the files have the same name, in particular ch01_mt_example.cpp or code1.cpp. Not all of the code examples in the book are present.

Directory           Description
-------------       -------------------------------------------------------------------
├── Chapter01       Simple C++ thread plus mutex example
├── Chapter02       (same example)
├── Chapter03       (windows and Qt thread examples from book are missing)
│   ├── 1           Non-function pthread skeleton
│   ├── 2           More fleshed out pthread example
│   ├── 3           Skeleton making use of "Poco"
│   └── 4           Skeleton making use of "Poco"
├── Chapter04       C++ threading example with synchronization and condition variables
├── Chapter05       C++11 threading:
│   ├── 1           Thread ID
│   ├── 2           Thread sleep
│   ├── 3           Thread swap
│   ├── 4           Simplitic std::out from thread
│   ├── 5           Globale mutex std::cout
│   ├── 6           Shared/exclusive example
│   ├── 7           std::lock_guard example
│   ├── 8           packaged_task example
│   └── 9           future example
├── Chapter06       Debugging, based off Chapter04 scheduler code
├── Chapter07       Best practices, based off Chapter04 scheduler code
├── Chapter08
│   ├── 1           Simple atomic operation example with c++11 threading
│   └── 2           <atomic> non-member functions example
├── Chapter09
│   └── 1
│       ├── 1       C-based MPI hello world
│       └── 2       C-based MPI + OpenMP hybrid hello world example
└── Chapter10
    └── 1           OpenCL example

Related Products

Suggestions and Feedback

Click here if you have any feedback or suggestions.

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781787121706

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.