AngouriMath
published
Field
Summary
The same primes as a snapshot nobody mutates, for readers outside the lock.
Remarks
primes after the lock had been released, which is not safe for a
List`1 that another thread may be growing:
backing array, so the reader can see the new
come back with a different element. A wrong prime is a well-formed integer and
propagates into factorisation rather than throwing. Publishing an array by a single
reference write keeps the read lock-free and correct: a reader takes the reference
once, which is atomic, and then indexes something that is never written again.
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online