To help LDC/GDC

Manu turkeyman at gmail.com
Tue Apr 9 01:30:52 PDT 2013


On 9 April 2013 18:03, Dicebot <m.strashun at gmail.com> wrote:

> On Tuesday, 9 April 2013 at 08:00:38 UTC, Manu wrote:
>
>> Errrm, only globals are shared by default.
>> Locals or allocated memory are not thread-local, can be passed wherever
>> they want, including other threads.
>>
>
> No, globals are also thread-local by default.


Sorry, that's what I meant, I typed the wrong thing >_<

Everything is.


Errrr, no?
Only globals are thread-local. Everything else is either stack or heap
allocated.

And it was intended that all variables that are supposed to be shared by
> threads in any reference-based manner are marked by shared, so you can't
> get it without copying or casting shared away (undefined!).
>

Yes but that's ultimately useless. If sharing is undefined, and you can
only use pass something to another thread via shared, then you basically
can't use threads.
shared is facilitated by blind casting. And codegen (which doesn't know if
something actually WAS shared or not) can't be assuming it wasn't.
I can't imagine a situation other than immutable where the compiler is able
to presume __restrict in this way.

Well, have I mentioned that "shared" implementation is somewhat lacking in
> D now? :)
>

It's almost a cruel joke. I try not to show that to people when I show them
D ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130409/2480376d/attachment-0001.html>


More information about the Digitalmars-d mailing list