Gauche
Gauche copied to clipboard
Clarify MT safety of random-source
Currently our srfi-27 random-source
is just a <mersenne-twister>
instance, which is not MT-safe. If some library function uses default-random-source
implicitly, that function becomes MT-unsafe, which is not desirable.
Choices:
- Make
random-source
MT-safe unconditinoally - Prominently say
default-random-source
is MT-unsafe and let every library function mutex it if necessary. - Provide MT-safe and MT-unsafe versions of random source, and use MT-safe verion for
default-random-source
.
Made math.mt-random
RNG thread-safe by default. Optionally the user can specify no mutex version for speed.
Need to extend srfi-27 make-random-source
to make no mutex version.
We may put off adding option to make-random-source
until we see the necessity. Closed for now.