MSWS (the class, not the PRNG) is thread safe by virtue of it being immutable. The state may be, but the class is not (there's no way to either modify or refer to the internal state from outside the class; you can only access copies of the current state through properties). Recall the code I posted in the second version of the MSWS class:deltarho[1859] wrote:A final word on something which has not been mentioned. Bot PCG32II and MsWs have something in common: They are both thread safe.
Code: Select all
/'
...
'/
?
? "How to clone your instance..."
?
var anotherRandomNumber = MsWs( _
randomNumber.seed, _
randomNumber.weilSequence, _
randomNumber.sequence )
for i as integer = 1 to 100
? randomNumber.one(), anotherRandomNumber.one()
next