<div dir="ltr">On 9 April 2013 18:03, Dicebot <span dir="ltr"><<a href="mailto:m.strashun@gmail.com" target="_blank">m.strashun@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tuesday, 9 April 2013 at 08:00:38 UTC, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Errrm, only globals are shared by default.<br>
Locals or allocated memory are not thread-local, can be passed wherever<br>
they want, including other threads.<br>
</blockquote>
<br></div>
No, globals are also thread-local by default.</blockquote><div><br></div><div style>Sorry, that's what I meant, I typed the wrong thing >_<</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Everything is.</blockquote><div><br></div><div style>Errrr, no?</div><div style>Only globals are thread-local. Everything else is either stack or heap allocated.</div><div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 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!).<br></blockquote>
<div><br></div><div style>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.</div><div style>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.</div>
<div style>I can't imagine a situation other than immutable where the compiler is able to presume __restrict in this way.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Well, have I mentioned that "shared" implementation is somewhat lacking in D now? :)<br>
</blockquote></div><br></div><div class="gmail_extra" style>It's almost a cruel joke. I try not to show that to people when I show them D ;)</div></div>