Concurrency
ConcurrencyCppCon 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 | 5 月前3Concurrency in Rust
Concurrency in Rust Alex Crichton What’s Rust? Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. Concurrency? Libraries Futures Futures Rust? What’s concurrency? In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other. Why concurrency? Getting our feet wet // What does this print? int main() { int pid = fork(); printf("%d\n", pid); } Concurrency is hard! • Data Races • Race Conditions • Deadlocks •0 码力 | 43 页 | 648.31 KB | 1 年前3Back to Basics: Concurrency
Back 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 | 5 月前3Back to Basics: Concurrency
1Please 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 | 5 月前3Concurrency Patterns I
Suspension 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 | 5 月前3Concurrency Patterns in C
Concurrency Patterns in Go Artsiom Bukhautsou Senior Backend Engineer @Nord SecurityFan-out 🌱 Pipeline 🤔 Fan-in, Fan-out, Pipeline 🦾 Agenda Fan-in 🌱 Tee 🌱 1. 2. 3. 4. 5.Why learn these0 码力 | 20 页 | 1.35 MB | 5 月前3Coroutines and Structured Concurrency in Practice
Easier 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 | 5 月前3Sender Patterns to Wrangle Concurrency in Embedded Devices
Sender 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 | 5 月前3Making Games Start Fast: A Story About Concurrency
0 码力 | 76 页 | 2.22 MB | 5 月前3cppcon 2021 safety guidelines for C parallel and concurrency
Trading/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 | 5 月前3
共 968 条
- 1
- 2
- 3
- 4
- 5
- 6
- 97