diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2020-08-13 20:48:14 +0000 |
---|---|---|
committer | Conrad Meyer <cem@FreeBSD.org> | 2020-08-13 20:48:14 +0000 |
commit | 8a0edc914ffdda876987add5128da3ee236a6a12 (patch) | |
tree | 1555e019838dfb5459fdcfad310285ab48d7f879 /share/man/man9/Makefile | |
parent | 1e04d9ff3e2565a402e449eb59b30b826bb2894a (diff) | |
download | src-8a0edc914ffdda876987add5128da3ee236a6a12.tar.gz src-8a0edc914ffdda876987add5128da3ee236a6a12.zip |
Add prng(9) API
Add prng(9) as a replacement for random(9) in the kernel.
There are two major differences from random(9) and random(3):
- General prng(9) APIs (prng32(9), etc) do not guarantee an
implementation or particular sequence; they should not be used for
repeatable simulations.
- However, specific named API families are also exposed (for now: PCG),
and those are expected to be repeatable (when so-guaranteed by the named
algorithm).
Some minor differences from random(3) and earlier random(9):
- PRNG state for the general prng(9) APIs is per-CPU; this eliminates
contention on PRNG state in SMP workloads. Each PCPU generator in an
SMP system produces a unique sequence.
- Better statistical properties than the Park-Miller ("minstd") PRNG
(longer period, uniform distribution in all bits, passes
BigCrush/PractRand analysis).
- Faster than Park-Miller ("minstd") PRNG -- no division is required to
step PCG-family PRNGs.
For now, random(9) becomes a thin shim around prng32(). Eventually I
would like to mechanically switch consumers over to the explicit API.
Reviewed by: kib, markj (previous version both)
Discussed with: markm
Differential Revision: https://reviews.freebsd.org/D25916
Notes
Notes:
svn path=/head/; revision=364219
Diffstat (limited to 'share/man/man9/Makefile')
-rw-r--r-- | share/man/man9/Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 33e162d5fae0..993f65188543 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -272,6 +272,7 @@ MAN= accept_filter.9 \ printf.9 \ prison_check.9 \ priv.9 \ + prng.9 \ proc_rwmem.9 \ pseudofs.9 \ psignal.9 \ @@ -1745,6 +1746,10 @@ MLINKS+=printf.9 log.9 \ printf.9 uprintf.9 MLINKS+=priv.9 priv_check.9 \ priv.9 priv_check_cred.9 +MLINKS+=prng.9 prng32.9 \ + prng.9 prng32_bounded.9 \ + prng.9 prng64.9 \ + prng.9 prng64_bounded.9 MLINKS+=proc_rwmem.9 proc_readmem.9 \ proc_rwmem.9 proc_writemem.9 MLINKS+=psignal.9 gsignal.9 \ |