22 #include <unordered_set> 25 #include <glog/logging.h> 29 using namespace folly;
38 #if FOLLY_HAVE_EXTRANDOM_SFMT19937 46 for (
int i = 0;
i < 1024; ++
i) {
56 result_type operator()() {
60 static constexpr result_type
min() {
63 static constexpr result_type
max() {
75 for (
int i = 0;
i < 1024; ++
i) {
83 std::vector<uint32_t> seeds(n);
84 std::vector<std::thread>
threads;
85 for (
int i = 0;
i < n; ++
i) {
89 for (
auto&
t : threads) {
92 std::sort(seeds.begin(), seeds.end());
93 for (
int i = 0;
i < n - 1; ++
i) {
106 constexpr
int kTestSize = 1000;
108 std::vector<uint32_t> vals;
110 rng.seed(0xdeadbeef);
111 for (
int i = 0;
i < kTestSize; ++
i) {
114 rng.seed(0xdeadbeef);
115 for (
int i = 0;
i < kTestSize; ++
i) {
120 std::unordered_set<uint32_t>(vals.begin(), vals.end()).
size());
125 std::vector<uint64_t> vals;
127 rng.seed(0xdeadbeef);
128 for (
int i = 0;
i < kTestSize; ++
i) {
131 rng.seed(0xdeadbeef);
132 for (
int i = 0;
i < kTestSize; ++
i) {
137 std::unordered_set<uint64_t>(vals.begin(), vals.end()).
size());
156 auto pid2 =
wait(&status);
161 if (WEXITSTATUS(status) == buffer && retries-- > 0) {
std::vector< uint8_t > buffer(kBufferSize+16)
static std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value, T >::type secureRandom()
#define EXPECT_EQ(val1, val2)
—— Concurrent Priority Queue Implementation ——
std::vector< std::thread::id > threads
constexpr auto size(C const &c) -> decltype(c.size())
_t< StateSize< RNG >> StateSizeT
bool wait(Waiter *waiter, bool shouldSleep, Waiter *&next)
std::mt19937 DefaultGenerator
#define EXPECT_NE(val1, val2)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
#define EXPECT_LT(val1, val2)
uint32_t randomNumberSeed()
TEST(SequencedExecutor, CPUThreadPoolExecutor)