On Monday, 4 March 2024 at 16:02:50 UTC, Andy Valencia wrote:
On Monday, 4 March 2024 at 03:42:48 UTC, Richard (Rikki) Andrew
Cattermole wrote:
A way to do this without spawning threads manually:
...
Thank you! Of course, a thread dispatch per atomic increment
is going to be s.l.o.w., so not surprising you had to trim the
iterations.
Bug I still hope to be able to share memory between spawned
threads, and if it isn't a shared ref of a shared variable,
then what would it be? Do I have to use the memory allocator?
There is `__gshared` type qualifier, but unlike plain `shared` it
is up to you to ensure valid concurrency access as stated in the
docs.
https://dlang.org/spec/const3.html#shared_global