filmov
tv
CppCon 2018: Geoffrey Romer “What do you mean 'thread-safe'?”
Показать описание
—
—
How can we communicate with other developers about the safety of our C++ code against the hazards of concurrency? Terms like "thread-safe" don't always have a clear meaning, and more precise terms like "data race" and "race condition" often operate at the wrong level of abstraction. In order to communicate effectively about these issues, we need straightforward ways to talk about the safety requirements that APIs impose, and what goes wrong if you violate them.
In this talk, I will present the simple yet precise vocabulary we use for talking about these issues at Google: an "API race" happens when two operations access the same object concurrently, in violation of its contract. For most C++ types, that contract can be classified as "thread-safe" or "thread-compatible" depending on what combinations of operations can cause an API race (the remainder are called "thread-unsafe"), and that two-word classification usually tells you everything you need to know to avoid API races on the object. This is significant because if you can avoid API races, you can avoid not only all data races but also many race conditions.
—
Geoffrey Romer, Google
Software Engineer
I'm a Staff Software Engineer on the C++ Library Team at Google, and the lead author of Google's C++ concurrent programming guide. My work focuses on improving the C++ programming experience at Google and beyond, which has led me to focus on problem areas such as concurrent programming, error handling, hashing, and memory management. I'm a co-owner of Google's C++ style guide, and have been active on the C++ Standards committee since 2014, including a stint as editor of the Library Fundamentals TS. Currently, I'm leading Google's efforts to adopt coroutines in C++, and working on API designs for mitigating speculation attacks such as Spectre Variant 1.
—
*-----*
*-----*
—
How can we communicate with other developers about the safety of our C++ code against the hazards of concurrency? Terms like "thread-safe" don't always have a clear meaning, and more precise terms like "data race" and "race condition" often operate at the wrong level of abstraction. In order to communicate effectively about these issues, we need straightforward ways to talk about the safety requirements that APIs impose, and what goes wrong if you violate them.
In this talk, I will present the simple yet precise vocabulary we use for talking about these issues at Google: an "API race" happens when two operations access the same object concurrently, in violation of its contract. For most C++ types, that contract can be classified as "thread-safe" or "thread-compatible" depending on what combinations of operations can cause an API race (the remainder are called "thread-unsafe"), and that two-word classification usually tells you everything you need to know to avoid API races on the object. This is significant because if you can avoid API races, you can avoid not only all data races but also many race conditions.
—
Geoffrey Romer, Google
Software Engineer
I'm a Staff Software Engineer on the C++ Library Team at Google, and the lead author of Google's C++ concurrent programming guide. My work focuses on improving the C++ programming experience at Google and beyond, which has led me to focus on problem areas such as concurrent programming, error handling, hashing, and memory management. I'm a co-owner of Google's C++ style guide, and have been active on the C++ Standards committee since 2014, including a stint as editor of the Library Fundamentals TS. Currently, I'm leading Google's efforts to adopt coroutines in C++, and working on API designs for mitigating speculation attacks such as Spectre Variant 1.
—
*-----*
*-----*
Комментарии