Unsafe, unchecked message-passing with std.concurrency

Elronnd elronnd at elronnd.net
Thu Aug 27 08:59:45 UTC 2020

On Thursday, 27 August 2020 at 08:46:31 UTC, Simen Kjærås wrote:
> Since you're fine with unsafe, unchecked - why not just lie to 
> the compiler? Cast the data to shared and send it on its merry 
> way?

It's bothersome and error-prone.  I have to cast the data to 
shared.  I also have to remember to receive a shared object on 
the other side (and if I forget, I won't get a compile error, 
stuff will just silently break).  Once I've received it, I have 
to cast away the shared again if I want to be able to use the 
object for anything.  I'll do that if I have to, (or write my 
message-passing library, or repurpose one from C), but would be 
nice if there were another solution.

More information about the Digitalmars-d mailing list