2
Is there any problem of race condition in the code below?
Private Shared Sub TestRandomNumberGeneration(ByVal random As Random)
Dim failed As Boolean = False
Parallel.For(0, 100000, Sub(i, state)
Dim [next] As Integer = random.Next()
If [next] = 0 Then
Volatile.Write(failed, True)
state.Stop()
End If
End Sub)
Assert.IsFalse(failed)
End Sub
Thank you so much for formatting :D
– Horácio J. C. Filho
You’re welcome! Now in color :)
– bfavaretto
Ficooooou mass :D :D :D :D
– Horácio J. C. Filho
@Horacio.C.Son, you can learn the essentials of editing here: http://answall.com/editing-help for the next questions :)
– Bacco