Compiling with **\--threadAnalysis:off** did allow the program to compile and
run with no segfaults, and it produces the correct results, but it's 2x slower
than the serial version.
In the code snippet, the **next**, **seg**, and **primes** arrays (seqs), and
the constant **rescnt** are global
GC unsafe means you're using a mutable variable from outside of thread scope.
Very likely you're using a global variable or such which not local to that
invoked thread.
For safer solution, change your code to remove any instance of mutable shared
variables.
For unsafe and not recommended
Using Nim 0.17.
Afer reading the Nim manual on Parallel programming, and how to use **spawn**
and **parallel** I can't get the following code to compile.
proc residue_sieve(r: int, Kn: int) =
let row = r * pcnt# set address to ith row in next[]
let