Created
July 1, 2021 21:02
-
-
Save jeremy-rifkin/6bb5f9993963ff40e78acb8c3d23a99c to your computer and use it in GitHub Desktop.
This can only end well
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <atomic> | |
#include <stdlib.h> | |
constexpr std::memory_order orders[] = { | |
std::memory_order_relaxed, | |
std::memory_order_consume, | |
std::memory_order_acquire, | |
std::memory_order_release, | |
std::memory_order_acq_rel, | |
std::memory_order_seq_cst | |
}; | |
std::memory_order memory_order_roulette() { | |
return orders[rand() % std::size(orders)]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment