- changed status to resolved
(math mt-random) raises an error on multi thread use
Issue #212
resolved
This occasionally throws an error
(import (rnrs) (math) (math mt-random) (srfi :18) (sagittarius control))
(define prng (pseudo-random MT))
(define bytes '(256 256 256 256))
(define threads
(map (lambda (n)
(make-thread
(lambda () (dotimes (i n) (read-random-bytes prng n))))) bytes))
(map thread-join! (map thread-start! threads))
The error just indicates an index out of bound. It should throw no error even if the prng
returns the same value.
Comments (1)
-
reporter - Log in to comment
Making MT random thread safe. (Fixing
#212)→ <<cset 88a5102a3fe4>>