MCPcopy Create free account
hub / github.com/apache/impala / CreateThreadLocalRngs

Method CreateThreadLocalRngs

be/src/testutil/rand-util.h:53–58  ·  view source on GitHub ↗

Create 'num_threads' rngs, seeded using 'seed_rng'. Used when we want each thread to have its own RNG (since they are not thread-safe).

Source from the content-addressed store, hash-verified

51 /// Create 'num_threads' rngs, seeded using 'seed_rng'. Used when we want each thread
52 /// to have its own RNG (since they are not thread-safe).
53 static vector<std::mt19937> CreateThreadLocalRngs(
54 int num_threads, std::mt19937* seed_rng) {
55 vector<std::mt19937> rngs(num_threads);
56 for (std::mt19937& rng : rngs) rng.seed((*seed_rng)());
57 return rngs;
58 }
59
60 /// Create a random temporary directory with the given prefix returning the path to the
61 /// newly created directory. If 'rm_on_destruction' is true, the directory will be

Callers

nothing calls this directly

Calls 1

seedMethod · 0.80

Tested by

no test coverage detected