Concurrency
org/z/vqnfvh9WxCppCon 2023 8 David Olsen - Back to Basics: Concurrency STD::COUNTING_SEMAPHORE Lightweight synchronization primitive that can control access to a shared resource Maintains an internal counter Calls Parent thread write Child thread readCppCon 2023 65 David Olsen - Back to Basics: Concurrency SYNCHRONIZATION: THREAD CREATION Creating a thread synchronizes the parent and child threads All memory changes thread write Parent thread readCppCon 2023 69 David Olsen - Back to Basics: Concurrency SYNCHRONIZATION: THREAD JOIN Joining a thread synchronizes the parent and child threads All memory changes0 码力 | 160 页 | 2.91 MB | 5 月前3C++ Memory Model: from C++11 to C++23
dathskovsky@speedata.io | www.linkedin.com/in/alexdathskovsky Volatile ● Volatile is not a synchronization tool ● Volatile doesn’t affect threading ● It's not an atomic value ● It doesn’t add barriersAlex about itAlex Dathskovsky | alex.dathskovsky@speedata.io | www.linkedin.com/in/alexdathskovsky Synchronization contAlex Dathskovsky | alex.dathskovsky@speedata.io | www.linkedin.com/in/alexdathskovsky Compiler ExampleAlex Dathskovsky | alex.dathskovsky@speedata.io | www.linkedin.com/in/alexdathskovsky Synchronization Tools ● std::mutex, std::conditional_variable ● std::lock_guard – RAII helper for lockingAlex0 码力 | 112 页 | 5.17 MB | 5 月前3Coroutine Patterns and How to Use Them: Problems and Solutions Using Coroutines in a Modern Codebase
f.dev@gmail.comOutline • Motivation • Overview • Patterns • Lifetime • Exceptions • RAII • Synchronization • Conclusions Francesco Zoffoli - Coroutine Patterns and How to Use Them - CppCon 2023 4Motivation 2023 16 Queue Thread foo()_1 Executor foo()_2Patterns • Lifetime • Exceptions • RAII • Synchronization Francesco Zoffoli - Coroutine Patterns and How to Use Them - CppCon 2023 17Lifetime Francesco Patterns and How to Use Them - CppCon 2023 62Synchronization Francesco Zoffoli - Coroutine Patterns and How to Use Them - CppCon 2023 63Synchronization Needed? Francesco Zoffoli - Coroutine Patterns0 码力 | 70 页 | 1.45 MB | 5 月前3Concurrency Patterns I
Software Architecture (Volume 2 and 4) ▪ Concurrent Programming in JavaConcurrency Patterns Synchronization Patterns Dealing with Sharing ▪ Copied Value ▪ Thread-Specific Storage ▪ Future Dealing Suspension Concurrent Architecture Active Object Monitor Object ReactorConcurrency Patterns Synchronization Patterns Dealing with Sharing ▪ Copied Value ▪ Thread-Specific Storage ▪ Future Dealing }); future.get(); Future: receiver get Promise: sender set channelConcurrency Patterns Synchronization Patterns Dealing with Sharing ▪ Copied Value ▪ Thread-Specific Storage ▪ Future Dealing0 码力 | 39 页 | 1.14 MB | 5 月前3Design patterns for error handling in C++ programs using parallel algorithms and executors
forever) – e.g., 1 worker drops out before collective synchronization • Correct handling requires communication – Data movement, or synchronization (same thing) – Stop other workers from waiting forever – Reduce on “did everybody succeed?” – Collect info for recovery and/or reporting • Prevent synchronization-related deadlock – If you must synchronize… – … use it as opportunity to communicate error state Think of parallel loop body as a sequence of “local” blocks, punctuated by synchronization – Always participate in synchronization – Give each block a “bypass”: if error, do nothing harmlessly and pass0 码力 | 32 页 | 883.27 KB | 5 月前3C++20: An (Almost) Complete Overview
Concurrency Changes Atomic Smart Pointers Joining & Cancellable Threads The C++20 Synchronization Library Semaphores, efficient atomic waiting, latches, and barriers std::atomic_ref stop_requested() };41 The C++20 Synchronization Library Semaphores Lightweight synchronization primitives Can be used to implement any other synchronization concept: mutex, latches slot, i.e. only has two states: free slot or no free slot (perfect for a mutex)42 The C++20 Synchronization Library Latches & barriers Help with thread coordination Latches A thread 0 码力 | 85 页 | 512.18 KB | 5 月前3Back to Basics: Concurrency
allowed to look at the variable x while this thread is modifying it; and without some kind of synchronization, there’s no way to ensure that this thread isn’t modifying it right when you happen to be deadline) printf("A: %d\n", ++counter); threadB.join(); 11 This is a data race. No synchronization exists between these two accesses, and at least one of them is a write. (In fact, both are will produce different outputs. That might be considered a bug, but it’s not UB.)“Logical synchronization” Problem statement: std::thread threadB = std::thread([&](){ waitUntilUnblocked();0 码力 | 58 页 | 333.56 KB | 5 月前3CppCon 2021: Persistent Data Structures
Persistence ▶ Goal: Add persistence to concurrent data structures ▶ Leverage existing multithreaded synchronization guarantees A Persistent Hash Map for Graph Processing Workloads and a Methodology for Persistent Persistence ▶ Goal: Add persistence to concurrent data structures ▶ Leverage existing multithreaded synchronization guarantees ▶ Naive idea: flush-on-read [15] ▶ Flush newly created objects (ex. node and pointer) Persistence ▶ Goal: Add persistence to concurrent data structures ▶ Leverage existing multithreaded synchronization guarantees ▶ Naive idea: flush-on-read [15] ▶ Flush newly created objects (ex. node and pointer)0 码力 | 56 页 | 1.90 MB | 5 月前3From Eager Futures/Promises to Lazy Continuations: Evolving an Actor Library Based on Lessons Learned from Large-Scale Deployments
not running anything simultaneously (i.e., on multiple CPUs) ● but you still have all the synchronization problems from parallelism!executing code with futures/promises ● only need a single thread to not running anything simultaneously (i.e., on multiple CPUs) ● but you still have all the synchronization problems from parallelism! ● can execute in parallel by using a thread pool instead of a single not running anything simultaneously (i.e., on multiple CPUs) ● but you still have all the synchronization problems from parallelism! ● can execute in parallel by using a thread pool instead of a single0 码力 | 264 页 | 588.96 KB | 5 月前3Oracle VM VirtualBox 4.3.36 User Manual
table . . . . . . . . . . . . . . . . . . . . . . . . . 178 9.14 Fine-tuning timers and time synchronization . . . . . . . . . . . . . . . . . . . . 179 9.14.1 Configuring the guest time stamp counter (TSC) . . . 179 9.14.3 Tuning the Guest Additions time synchronization parameters . . . . . . 179 9.14.4 Disabling the Guest Additions time synchronization . . . . . . . . . . . 180 9.15 Installing the alternate passing through SSE4.1 / SSE4.2 instructions . . . . . 197 9.27 Support for keyboard indicators synchronization . . . . . . . . . . . . . . . . . . 197 10 Technical background 198 10.1 Where VirtualBox stores0 码力 | 380 页 | 3.79 MB | 5 月前3
共 89 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
相关搜索词
ConcurrencyC++MemoryModelfrom11to23CoroutinePatternsandHowUseThemProblemsSolutionsUsingCoroutinesinModernCodebaseDesignpatternsforerrorhandlingprogramsusingparallelalgorithmsexecutors20AnAlmostCompleteOverviewBackBasicsCppCon2021PersistentDataStructuresFromEagerFuturesPromisesLazyContinuationsEvolvinganActorLibraryBasedonLessonsLearnedLargeScaleDeploymentsOracleVMVirtualBox4.336UserManual