3 ms·
I've used it to store the state of a global RNG. Thread local state is faster than locking a shared RNG and the observable behaviour is the same. For high qual
by CodesInChaos 6y ago
I've used it to store the state of a global RNG. Thread local state is faster than locking a shared RNG and the observable behaviour is the same.
For high quality code you often pass around the RNG instance explicitly (improves testability), but often I just want a random number without bothering with explicit state management.
- jstrong 6y agothat seems pretty legit.