The C++20 Synchronization Library - Bryce Adelstein Lelbach - CppCon 2019

preview_player
Показать описание



In the decade since C++11 shipped, the hardware landscape has changed drastically. 10 years ago, we were still in the early stages of the concurrent processing revolution; 2 to 4 hardware threads were common and more than 10 was "many". Our tolerance for synchronization latency was greater; we were willing to pay microseconds and milliseconds.

Today, dozens and hundreds of threads are common, and "many" means hundreds of thousands. Concurrent applications are plagued by contention challenges that were unimaginable a decade ago. With the traditional tools we have today, programmers often have to choose between unacceptable contention and unacceptable high latency when synchronizing between threads.

The C++20 synchronization library brings solutions - new lightweight synchronization primitives that can efficiently marshall hundreds of thousands of threads:

- `std::atomic::wait`/`std::atomic::notify_*`: Efficient atomic waiting.
- `std::atomic_ref`: Atomic operations on non-`std::atomic` objects.
- `std::counting_semaphore`: Lightweight access coordination.
- `std::latch` and `std::barrier`: Marshalling groups of threads.

In this example-oriented talk, you'll learn how and when to use these new tools to build scalable, modern C++ applications that can run in parallel on virtually any hardware, from embedded controllers to server CPUs to modern GPUs.

Bryce Adelstein Lelbach
NVIDIA
CUDA C++ Core Libraries Lead
San Francisco Bay Area

Bryce Adelstein Lelbach has spent nearly a decade developing libraries in C++. Bryce is passionate about C++ evolution and is one of the leaders of the C++ community. He is an officer of ISO/IEC JTC1/SC22/WG21, the C++ Standards Committee. Bryce chairs both the C++ Committee's Tooling Study Group (SG15) and Library Evolution Incubator (SG18). He is the program chair for the C++Now and CppCon conferences, and the chief organizer of the Bay Area C++ User Group. On the C++ Committee, he has personally worked on the C++17 parallel algorithms, executors, futures, senders/receivers, multidimensional arrays, and modules. Bryce works at NVIDIA, where he leads the CUDA C++ core libraries team. He is one of the initial developers of the HPX parallel runtime system. He also helped start the LLVMLinux initiative and has occasionally contributed to the Boost C++ libraries.

*--*
*-----*
Рекомендации по теме