On Wednesday, 9 October 2013 at 03:46:16 UTC, Andrei Alexandrescu
wrote:
On 10/8/13 8:31 PM, Walter Bright wrote:
On 10/8/2013 8:18 PM, deadalnix wrote:
We also badly need to be able to use type qualifier. We must
stop the world when collecting thread local data or immutable
one.
That do not
make any sense.
Making this work is fraught with difficulty. It is normal
behavior in D
to create local data with new(), build a data structure, and
then cast
it to shared so it can be transferred to another thread.
Stop right there. NO. That is NOT normal behavior, and if we
require it in order to work we have made a mistake.
There should be NO casting required to get work done in client
code.
I have to concur with Andrei on that one. The win is simply so
big that we can't ignore it. I you really want to do something
like that, you can allocate as shared, cast to TL build the
structure and cast back to shared.
When you break the type system, all guarantee are thrown away,
and breaking it twice won't make thing worse at this point.
That being said, isolated is probably something we want to add in
the future.