Skip to content

Commit

Permalink
Merge pull request #387 from manshreck/master
Browse files Browse the repository at this point in the history
Docs push for atomic danger doc and blog post
  • Loading branch information
manshreck committed Jan 18, 2022
2 parents 8816dfa + 44e1bb5 commit ee27b50
Show file tree
Hide file tree
Showing 5 changed files with 407 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ DEPENDENCIES
tzinfo-data

RUBY VERSION
ruby 2.7.2p137
ruby 2.7.4p191

BUNDLED WITH
2.1.4
6 changes: 5 additions & 1 deletion _includes/side-nav-cpp.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
<a href="{{ site.baseurl }}/docs/cpp/tools/api-upgrades" {% if current[4] == 'api-upgrades.html' %}class='current'{% endif %}>Automated Upgrades</a></li>
<li class="doc-side-nav-list-item">
<a href="{{ site.baseurl }}/docs/cpp/tools/upgrades/" {% if current[4] == 'upgrades' %}class='current'{% endif %}>Upgrade Tools</a></li>

</li>
<li><h6 class="doc-side-nav-title">General Guides</h6></li>
<li class="doc-side-nav-list-item">
<a href="{{ site.baseurl }}/docs/cpp/atomic_danger" {% if current[4] == 'atomic_danger.html' %}class='current'{% endif %}>Atomic C++ Operations</a></li>
<li class="doc-side-nav-list-item">
<li><h5 class="doc-side-nav-title"><a href="{{ site.baseurl }}/docs/python/"><b>Python Devguide</b></a></h5></li>
</ul>
32 changes: 32 additions & 0 deletions _posts/2022-01-18-atomic-operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: "The Danger of Atomic Operations"
layout: blog
sidenav: side-nav-blog.html
published: true
permalink: blog/01222022-atomic-operations
type: markdown
category: blog
excerpt_separator: <!--break-->
---

By [Ashley Hedberg](mailto:ahedberg@google.com), Software Engineer

The C++ Standard provides a library for performing fine-grained atomic
operations (e.g. `std::atomic`). Engineers sometimes reach for these
atomic operations in the hope to introduce some lock-free mechanism,
or to introduce clever tricks to improve performance. At Google, we’ve
found -- more often than not -- that such attempts lead to code that
is difficult to get right, hard to understand, and can often introduce
subtle and sometimes dangerous bugs.

We’ve now published a guide on the danger of these atomic operations,
and are publishing it to Abseil as a general programming guide. Atomic
operations should be used only in a handful of low-level data
structures which are written by a few experts and then reviewed and
tested thoroughly. Most programmers make mistakes when they attempt
direct use of atomic operations. Even when they don't, the resulting
code is hard for others to maintain.

For more information, check out
[The Danger of Atomic Operations](https://abseil.io/docs/cpp/atomic_danger).

Loading

0 comments on commit ee27b50

Please sign in to comment.