ConcurrencyConcurrencyCppCon 2023 2 David Olsen - Back to Basics: Concurrency Alxndrul, CC BY-SA 4.0, via Wikimedia CommonsCppCon 2023 3 David Olsen - Back to Basics: Concurrency Alxndrul, CC BY-SA 4.0, via Wikimedia CommonsCppCon 4 David Olsen - Back to Basics: Concurrency Jetstar Airways (jetstar.com), CC BY-SA 2.0, via Wikimedia CommonsCppCon 2023 5 David Olsen - Back to Basics: Concurrency Kentaro Iemoto from Tokyo, Japan CppCon, October 5, 2023 BACK TO BASICS: CONCURRENCYCppCon 2023 7 David Olsen - Back to Basics: Concurrency STD::THREAD int main() { std::thread my_thread{[](int z){ std::cout << "Hello from thread:0 码力 | 160 页 | 2.91 MB | 6 月前3
Back to Basics: ConcurrencyBack to Basics: Concurrency I also do C++ training! arthur.j.odwyer@gmail.com Arthur O’Dwyer 2020-09-18Outline ● What is a data race and how do we fix it? [3–12] ● C++11 mutex and RAII lock types [46–52] ● Bonus C++20 slides [53–58] Questions? 2What is concurrency? ● Concurrency means doing two things concurrently — “running together.” Maybe you’re switching back music ● In extremely broad strokes, parallelism is a hardware problem (think multiple CPUs) and concurrency is a software problem (think time-sharing, but also Intel’s “hyperthreading”). 3Why does C++0 码力 | 58 页 | 333.56 KB | 6 月前3
Back to Basics: Concurrency1Please do not redistribute slides without prior permission. 2Back to Basics: Concurrency Mike Shah, Ph.D. @MichaelShah | mshah.io | www.youtube.com/c/MikeShah 4:45 pm MDT, Mon. October 25 60 minutes the free lunch being over for programmers? In this talk we provide a gentle introduction to concurrency with the modern C++ std::thread library. We will introduce topics with pragmatic code examples and showing how these programming primitives enable concurrency. In addition, we will show the common pitfalls to be aware of with concurrency: data races, starvation, and deadlock (the most extreme0 码力 | 141 页 | 6.02 MB | 6 月前3
Concurrency Patterns ISuspension Concurrent Architecture Active Object Monitor Object ReactorConcurrency Patterns ▪ Concurrency with Modern C++ (50 % off during the CppCon2021)www.ModernesCpp.com Rainer Grimm Training, Coaching0 码力 | 39 页 | 1.14 MB | 6 月前3
Coroutines and Structured Concurrency in PracticeEasier object lifetime management • Easier error propagation But we need some structureStructured concurrency And why we careA typical async framework class Task { ... } represents a unit of background only run when it’s being awaited by another task https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/Sketching an API Taskgreet() { cout << "going to co_await resolveOn(name, "1.1.1.1"); }); co_return visit(identity{}, v); }Structured concurrency Tasks naturally form a "call tree" • coroutines • leaf awaitables (sleeping, I/O, etc) • combiners 0 码力 | 103 页 | 1.98 MB | 6 月前3
Sender Patterns to Wrangle Concurrency in Embedded DevicesSender Patterns to Wrangle Sender Patterns to Wrangle Concurrency in Embedded Devices Concurrency in Embedded Devices Michael Caisse Michael Caisse michael.caisse@intel.com michael.caisse@intel.com Ben the count one digit at a time. 3. When done, yell "End of Line" Exercise 7async/concurrency 8async/concurrency GPIO Timer 1 Timer 2 I2C DMA Half-Duplex Serial core 9Sender World View 10Sender Expressions not Statements Localized reasoning of concurrency Brings the events to the state 72Raising the Level of Abstraction Enabled: Structured concurrency "Structured" debugging "Structured" monitoring0 码力 | 106 页 | 26.36 MB | 6 月前3
Making Games Start Fast: A Story About Concurrency0 码力 | 76 页 | 2.22 MB | 6 月前3
cppcon 2021 safety guidelines for C parallel and concurrencyTrading/Embedded ● Editor: C++ SG5 Transactional Memory Technical Specification ● Editor: C++ SG1 Concurrency Technical Specification ● MISRA C++ and AUTOSAR ● Chair of Standards Council Canada TC22/SC32 some from our own contributions • Many joined, average 5-8 per meeting • Also consulted outside concurrency and safety experts • Shared Drive of Phase 1 analysis: • https://docs.google.com/document/d/14 clear • In these cases we wonder if an [[intention:]] attribute might help Where should parallel/concurrency/hetero rules go? Human decidable Tool decidable Suitable tools in order of preference Easy Easy0 码力 | 52 页 | 3.14 MB | 6 月前3
CppCon2021 Concurrency TS2have a Concurrency TS? • Why do we need a new one? • implementation status 2.TS2 Hazard Pointer • how I learn to love C++ tricks 3.TS2 RCU • From C to C++ in 2500 days 3 3 © 2021. 4 Concurrency TS1: TS1: Don’t we already have a TS? • Produced in 2015 • Produced by the Concurrency Study Group (SG1) with input from LEWG, LWG • Separate document and is not part of ISO C++ Standard • Goal: Eventual Inclusion https://github.com/cplusplus/concurrency-ts 4 © 2021. 5 What was in Concurrency TS1? • Improvements to std::future • Latches and Barriers • Atomic smart pointers 5 © 2021. 6 Since Concurrency TS1? • Improvements0 码力 | 58 页 | 1.62 MB | 6 月前0.03
Interesting Upcoming Features from Low Latency, Parallelism and Concurrency(P3179; Michael), may be Parallel Algorithms (P2500)C++26: Atomic Min/MaxC++26: Improving C++20 Concurrency primitives atomic min/max (P0493)Atomic min/max motivation (P0493) Long history - almost as untag_pointer(tagged). */ ExampleBringing parallelism to std::ranges algorithmsISO C++ Parallelism/Concurrency Programming Language (based on Gonzalo’s ISC C++ BoF) C++ 2023 Ranges++ many Multi-dimensional layouts [Bryce, Christian] Concurrency++ RCU, HP [MichaelW, Gonzalo, Maged, Paul M] SIMD [Matthias, Daniel, Ruslan] C++ 2017 Parallel Algorithms [many] Concurrency++ Memory Model++ [MichaelW, Maged0 码力 | 56 页 | 514.85 KB | 6 月前3
共 125 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13













