Tag: smartpointer

Smarter Cpp Atomic Smart Pointers – Efficient Concurrent Memory Management – Daniel Anderson – CppCon 2022

  • Lobby
  • Tag Archives: smartpointer

https://cppcon.org/
---

Smarter C++ Atomic Smart Pointers - Efficient Concurrent Memory Management for Everybody - Daniel Anderson - CppCon 2022
https://github.com/CppCon/CppCon2022

Memory management is hard, especially for concurrent code, even for concurrency experts. To make it more manageable, C++ programmers almost always rely on high-level abstractions such as smart pointers and deferred reclamation techniques such as hazard-pointers and RCU that offer to reduce the burden. These abstractions, however, come with many tradeoffs. In this talk, we will discuss recent library solutions that aim to combine the advantages of these techniques to produce a solution that is as easy to use as smart pointers but as fast and scalable as deferred reclamation techniques. We aim to convince the audience that scalable concurrent code with the performance of expert-written code can be written using abstractions as simple as smart pointers.

As a starting point, we will discuss existing techniques and their tradeoffs. Smart pointers, such as the recently standardized atomic shared pointer, drastically reduce programmer effort, but existing implementations do not scale and result in low-performance code. Advanced deferred reclamation techniques such as hazard-pointers and RCU, as included in the latest concurrency TS, are highly scalable but very subtle and difficult to use correctly. We will show that they are a common source of memory bugs even when used by concurrency experts.

The main part of the talk will then focus on several recent library interfaces that aim to combine the best of both worlds from atomic smart pointers and deferred reclamation techniques. We will also discuss some techniques that can be used to efficiently implement these interfaces and explore their performance.
---

Daniel Anderson

Daniel is a fifth-year PhD candidate in the Computer Science Department at Carnegie Mellon University. He is interested in the design of fast parallel algorithms and likes to write C++ libraries that make parallel computing easier and more accessible. He is a recipient of a best paper award from the ACM Symposium on Parallelism in Algorithms and Architectures conference.
__

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #memorymanagement

Filed under: UncategorizedTagged with: , , , ,

A Lock-Free Atomic Shared Pointer in Modern Cpp – Timur Doumler – CppCon 2022

  • Lobby
  • Tag Archives: smartpointer

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

A Lock-Free Atomic Shared Pointer in Modern Cpp - Timur Doumler - CppCon 2022
https://github.com/CppCon/CppCon2022

std::shared_ptr is a standard smart pointer utility widely used in modern C++. A commonly overlooked property of std::shared_ptr is that while its control block is thread-safe, the shared_ptr itself isn't. To fix this, C++20 introduced std::atomic<std::shared_ptr>. However, existing implementations are typically not lock-free, rendering std::atomic<std::shared_ptr> useless for low-latency and real-time applications.

What would it take to implement a lock-free atomic shared_ptr? In this talk, we first discuss the motivation and use case, review how std::shared_ptr works and the history of std::atomic<std::shared_ptr>. We then look at existing implementations and different implementation strategies. Finally, we present a new implementation of a lock-free atomic shared_ptr which is portable to multiple platforms.
---

Timur Doumler

Timur Doumler is the Developer Advocate for C++ tools at JetBrains and an active member of the ISO C++ standard committee. As a developer, he worked many years in the audio and music technology industry and co-founded the music tech startup Cradle. Timur is passionate about building inclusive communities, clean code, good tools, low latency, and the evolution of the C++ language.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , , , , ,