TECH Signal 243 2 feeds carried it
Windows XP chose initial user picture via reservoir sampling seeded with GetTickCount
Windows XP selected the initial user picture at random from a default directory using a one-pass reservoir sampling algorithm seeded with GetTickCount.
This reveals a practical implementation of reservoir sampling in a widely used operating system. Engineers can learn from the one-pass approach to avoid file system bottlenecks and handle dynamic collections. The safety cap also highlights a trade-off between completeness and performance.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
Windows XP used RtlRandomEx seeded with GetTickCount to generate the random numbers for picture selection.
The selection algorithm is a one-pass reservoir sampling variant that picks a random file without knowing the total count in advance.
The code stops after sampling 100 pictures to prevent pathological behavior with very large directories.
THE CLUSTER
↗