C++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 月前3hazard pointer synchronous reclamation
Beyond Concurrency TS2 – Maged Michael Folly open-source library: github.com/facebook/folly under synchronization/Hazptr.h Is Asynchronous Reclamation Always Enough? delete ptr shutdown_resource_X() Hazard Without global cleanup With global cleanup SequentialObjList list_; SharedObjList list_; Extra synchronization Removed private cache from Folly Using sharded domain lists instead Slow Not Scalable Is One Reclamation Beyond Concurrency TS2 – Maged Michael • Open-source: github.com/facebook/folly under synchronization/Hazptr.h • 2017: Need for synchronous reclamation. • 2017: Global cleanup as in TS2. • 2018:0 码力 | 31 页 | 856.38 KB | 5 月前3使用硬件加速Tokio - 戴翔
performant and balanced design with multiple SPSC queues. Key Tokio Scheduler Perf Gap: Synchronization is required for stealing Software Queue Issues Producer Enqueue Software Dequeue Software Dequeue Software Dequeue Software Enqueue Software Producer Consumer Consumer Consumer • Synchronization latency • Memory/Cache latency • CPU cycles latency DLB : Dynamic Load Balance DLB Enqueue pointers Dequeue Logic & Load Balancer Producer Producer Consumer Consumer Consumer • No Synchronization latency • No memory/cache latency • No CPU cycles DLB-Assist Channel Intro Hardware Senders0 码力 | 17 页 | 1.66 MB | 1 年前3Working with Asynchrony Generically: A Tour of C++ Executors
and can be passed to any async algorithm that accepts a sender. No extra allocation or synchronization is required.44 SENDERS AS AWAITABLES Most senders can be made awaitable in a coroutine read_socket_async(s2, buff2) ) | into_tuple(); /*...*/ } No extra allocation or synchronization is necessary.45 SENDERS AS AWAITABLES // This is a coroutine task type: template< class T0 码力 | 121 页 | 7.73 MB | 5 月前3
共 4 条
- 1