Aliases to mutable thread-local data not allowed [testable source code]

mark mark at qtrac.eu
Wed Mar 11 15:56:26 UTC 2020


On Wednesday, 11 March 2020 at 14:01:13 UTC, Simen Kjærås wrote:
[snip]
> Yeah, I forgot we cast to immutable to be able to send, so 
> receive has to receive immutable(Deb)*, after which you can 
> call deb.dup to get a mutable copy:
>
>     receive(
>         (immutable(Deb)* deb) { debForName[deb.name] = deb.dup; 
> },
>         (DoneMessage m) { jobs--; }
>     );

Thanks, that fixed it.

However, timing-wise the single threaded version (st) is fastest, 
then the task multi-threaded version (mt), and finally this 
version (mto).


More information about the Digitalmars-d-learn mailing list