You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Fix Issue 19075 - rt.util.random.Rand48.defaultSeed should prefer RDTSC or mach_absolute_time or QueryPerformanceCounter to ctime.time
`rt.util.random.Rand48.defaultSeed` generates a seed from the clock
using `ctime.time`. With `D_InlineAsm_X86_64` it would be better to
use the RDTSC instruction because it is much faster as well as being
finer precision. (Finer precision is a benefit not because we care
about accurate time, but because the differences between seeds
generated this way are potentially greater.) The same is true of
`mach_absolute_time` on macOS and `QueryPerformanceCounter` on
Microsoft Windows.
This PR doesn't use RDTSC with `D_InlineAsm_X86` because some x86
processors don't support RDTSC and because on x86 (but not x86-64)
Linux `prctl` can disable a process's ability to use RDTSC.
0 commit comments