Multi-Thread message passing approach

Kagamin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 16 07:21:10 PDT 2016


On Monday, 15 August 2016 at 01:53:33 UTC, Charles Hixson wrote:
> If I modify the code to attempt to pass a Tid[] as a member of 
> struct Start I get:
>
> /usr/include/dmd/phobos/std/concurrency.d(603): Error: static 
> assert  "Aliases to mutable thread-local data not allowed."
> test.d(47):        instantiated from here: send!(Start)
>
> and this seems to imply that the casting away of shared might 
> also be an unsafe access which just doesn't happen to be 
> detected by the library.

Currently not all types, that are supposed to be thread-safe, 
support shared, e.g. Semaphore, so it doesn't necessarily mean 
that sharing them is incorrect.


More information about the Digitalmars-d-learn mailing list