# My Multicore Talk at CppCon 2014

DevFeed: [My Multicore Talk at CppCon 2014](<https://devfeed.tech/articles/my-multicore-talk-at-cppcon-2014-20996.md>)

Original publisher: [Read original article](<https://preshing.com/20141024/my-multicore-talk-at-cppcon-2014>)

Author: Jeff Preshing

Published: 2014-10-24T10:40:00Z

Content type: article

Language: en

Sources: [Jeff Preshing](<https://devfeed.tech/sources/jeff-preshing.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Game engine](<https://devfeed.tech/topics/game-engine.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [MSVC](<https://devfeed.tech/topics/msvc.md>), [x86](<https://devfeed.tech/topics/x86.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [cppcon](<https://devfeed.tech/tags/cppcon.md>), [development](<https://devfeed.tech/tags/development.md>), [games](<https://devfeed.tech/tags/games.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [microsoft](<https://devfeed.tech/tags/microsoft.md>), [talk](<https://devfeed.tech/tags/talk.md>), [x86](<https://devfeed.tech/tags/x86.md>)

## AI overview

The article recaps a CppCon 2014 talk about how Ubisoft Montreal develops multicore game engines using threading patterns, custom concurrent objects, and atomic operations. It compares portable game-engine atomics with the low-level C++11 atomic library and discusses compiler ordering behavior on x86, including Microsoft's compiler and the risks associated with GCC or Clang.

## Source excerpt

Last month, I attended CppCon 2014 in Bellevue, Washington. It was an awesome conference, filled with the who's who of C++ development, and loaded with interesting, relevant talks. It was a first-year conference, so I'm sure CppCon 2015 will be even better. I highly recommend it for any serious C++ developer. While I was there, I gave a talk entitled, "How Ubisoft Montreal Develops Games For Multicore - Before and After C++11." You can watch the whole thing here: To summarize the talk: At Ubisoft Montreal, we exploit multicore by building our game engines on top of three common threading patterns. To implement those patterns, we need to write a lot of custom concurrent objects. When a concurrent object is under heavy contention, we optimize it using atomic operations. Game engines have their own portable atomic libraries. These libraries are similar to the C++11 atomic library's "low level" functionality. Most of the talk is spent exploring that last point: Comparing game atomics to low-level C++11 atomics. There was a wide range of experience levels in the room, which was cool. Among the attendees were Michael Wong, CEO of OpenMP and C++ standard committee member, and Lawrence Crowl, who authored most of section 29, "Atomic operations library," in the C++11 standard. Both of them chime in at various points. (I certainly wasn't expecting to explain the standard to the guy who wrote it!) You can download the slides here and grab the source code for the sample application here. A couple of corrections about certain points: Compiler Ordering Around C++ Volatiles At 24:05, I said that the compiler could have reordered some instructions on x86, leading to the same kind of memory reordering bug we saw at runtime on PowerPC, and that we were just lucky it didn't. However, I should acknowledge that in the previous console generation, the only x86 compiler we used at Ubisoft was Microsoft's. Microsoft's compiler is exceptional in that it does not perform those particular ins