AngouriMath
factorialCache
Field
Summary
The factorials computed so far, as a snapshot nobody mutates: [i] is i! .
Remarks
not a safe pattern for List`1 and the failure is silent rather than an
exception:
see the new
a different index — a wrong factorial, well-formed and enormous, from a method that
cannot fail. The last
A reader takes the reference once — that read is atomic — and then indexes an array
that is never written again, so it sees either the old complete snapshot or the new
one and never a half-grown one. The shared IEnumerator`1 that used to
carry the running product went with it: one enumerator advanced from several threads
is the same defect in a second place.
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online