Concurrency in C++: A Programmer’s Overview (part 2 of 2) - Fedor Pikus - CppNow 2022

Ғылым және технология

Slides: github.com/boostcon
CppNow Website: www.cppnow.org​
CppNow Twitter: @CppNow​
---
Concurrency in C++: A Programmer’s Overview (part 2 of 2) - Fedor Pikus - CppNow 2022
This talk is an overview of the C++ facilities for concurrent programming across different standard versions, from C++11 to C++20. C++11 was the first concurrency-aware C++ standard, and we will see what we got, what works, what sort of works, and what should be flat out avoided. The focus of the talk is on using C++ concurrency for maximum performance, and the presentation is illustrated by live benchmarks. We will learn about the memory model in C++ and why it matters, then study thread-safety guarantees provided by the language and the standard libraries and how to provide similar guarantees in your own code. Next, we will review the basic primitives of concurrency in C++: locks, barriers, conditions, atomics, and facilities for lock-free programming, as well as how (and what for) to use them in your concurrent programs. We will explore parallel algorithms and benchmark their performance, then see what the C++20 coroutines are all about. We will conclude with a brief review of the concurrency features that may be coming our way in C++23.
---
Fedor Pikus
Fedor G Pikus is a Technical Fellow and head of the Advanced Projects Team in the Siemens Digital Industries Software. His earlier positions included a Senior Software Engineer at Google and a Chief Scientist at Mentor Graphics (acquired by Siemens Software). He joined Mentor Graphics in 1998 when he made a switch from academic research in computational physics to the software industry. His responsibilities as a Technical Fellow include planning the long-term technical direction of Calibre products, directing and training the engineers who work on these products, design, and architecture of the software, and research in new design and software technologies. Fedor has over 25 patents and over 100 papers and conference presentations on physics, EDA, software design, and C++ language.
---
Videos Filmed & Edited By Bash Films bashfilms.com/
KZread Channel Managed By Digital Medium Ltd: events.digital-medium.co.uk
#Boost​ #Cpp​ #CppNow​

Пікірлер: 15

  • @georgeshopov5494
    @georgeshopov5494 Жыл бұрын

    Great talk - both parts... However, it felt some portion of the prepared material was dropped or lacked focus due to the constant interruptions with "ego" questions (when somebody asks things to only show off they know the subject)

  • @ChrisCox-wv7oo

    @ChrisCox-wv7oo

    8 ай бұрын

    I don't know how many were "know it all" questions / comments (on account of them being so quiet). I mostly noticed the argument over for_each. Fedor is brilliant but he deserves some credit for the difficulties. He has to more aggressively defend his time and simply state "I'm sorry, but I must keep going. Let's talk after." when he realizes he's behind. In addition, he needs to repeat any question or statement before answering so the conversation is clear. This is really common presentation etiquette. Great talk Fedor, really appreciated your thorough and meticulous presentation.

  • @rocknroooollllll
    @rocknroooollllll Жыл бұрын

    I really enjoy Fedor's talks. We could have got through more material if there were not lots of 'smart-arse' 'comments' and clarifications from almost inaudible audience 'contributors'. I hate these know-it-all types. They should stay quiet unless they have a microphone -- it spoils the presentation!

  • @bunpasi
    @bunpasi Жыл бұрын

    😲 That's a lot to take in account. Thanks for pointing these things (especially about atomics) out.

  • @Roibarkan
    @Roibarkan2 жыл бұрын

    1:39:14 note that destroying the handle is done by calling its destroy() method. A handle isn’t an RAII type.

  • @techmofey
    @techmofey Жыл бұрын

    Impressive talk!

  • @karloes0
    @karloes0 Жыл бұрын

    Great talk! I would like to read more about memory model and atomics. Does anyone have some recommendations?

  • @videofountain
    @videofountain2 жыл бұрын

    Thanks. Interesting talk.

  • @BoostCon

    @BoostCon

    2 жыл бұрын

    Glad you enjoyed it

  • @GeorgeTsiros
    @GeorgeTsiros2 жыл бұрын

    8:50 and onwards: std::atomic x{0}; In this case, are x += 1; and x = x + 1; *not* _semantically identical_ ? and I say _identical_ instead of _equivalent_ intentionally

  • @Peter_Cordes

    @Peter_Cordes

    2 жыл бұрын

    The first one is an atomic RMW. The second one is an atomic load and a *separate* atomic store. The whole increment is *not* an atomic transaction on x, so if you did this from multiple threads in parallel you'd lose some increments. They wouldn't see any tearing, though, only values that some other thread had actually stored. Yay. But if an atomic variable is only written by one thread, it's still safe and more efficient to do it the 2nd way (especially if you can relax the memory order so the load and store aren't seq_cst. Avoiding seq_cst store on x86 means it can be done with a plain store instead of xchg). If you need the store to be seq_cst, on x86 it's best to let to let the compiler do the whole thing as a lock inc or lock xadd, instead of mov-load / add / xchg.

  • @b0ki328
    @b0ki3287 ай бұрын

    Can anybody refer me to any details regarding the proof which is mentioned at 20:20?

  • @jackchan7697
    @jackchan7697 Жыл бұрын

    are there slides available? I can't find it in github .

  • @BoostCon

    @BoostCon

    Жыл бұрын

    Thank you for your question regarding the slides. They will become available in the near future.

  • @szymoniak75
    @szymoniak758 ай бұрын

    someone @ me when coroutines matured enough to be used with just standard C++

Келесі