CPPCON2020 Session Review: Back to Basics: Concurrency

Arthur O’Dwyer’s session is a lap around the concurrency facilities present in C++, starting with C++11. He starts the session with a gentle introduction to concurrency and parallelism pre-C++11 and walks you towards the memory model present in Modern C++, then he proceeds by presenting threads, joining threads, mutexes, scoped lock, atomics, shared_mutex, condition variables, counting semaphores, latches, barriers, promises, futures. You get the idea. He goes further by introducing usage idioms for some of these mechanisms.

Ay Chihuahua, Singleton again!

I mentioned in a previous post that Singletons are posible in Modern C++ using std::call_once and std::once_flag. That is explained here, too.

A cursory view of std::memory_order (or if you prefer Spanish, std::memory_order) will give you more details on the different relationships and their formal definitions, synchronizes-with being, IMO, the easiest.

As a side note, if you want a holistic approach for concurrency in C++, be sure you check Anthony Williams’ book, entitled C++ Concurrency in Action, 2nd Edition, and it’ll be a great complement to Arthur’s talk.

I like the fact that CPPCON is devoting time and speakers to Back to Basics sessions. I think they’re much needed and help bring novices or engineers coming from other languages into mainline C++ programming, helping them to navigate intricate–or sometimes historical–aspects of the language and are time savers, or simply help pointing in the right direction.

I also like the fact that Arthur does not make the session complicated. It is a nice introduction and leaves it up to you to dig up deeper on each of the facilities.

The Blue/Green Pattern

I like the last couple of slides defining this pattern. When sliding in new versions or services/microservices/configurations, is important to do it right. In my particular case, this was the highlight of the session and wished there had been more on it, but alas, Arthur was pressured with time. The technique is what I’m interested in, particularly since he mentioned C++20.

In a nutshell, I liked the approach that Arthur had. Easy going, reaching the Goldilocks principle: not too deep, not too shallow, just right. Got an hour to spare? Jump in!

This entry was posted in concurrent programming, software and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s