Am 28.03.2015 um 19:51 schrieb Walter Bright:
On 3/28/2015 8:41 AM, Sönke Ludwig wrote:
Am 28.03.2015 um 15:33 schrieb Russel Winder via Digitalmars-d-announce:
TLS is the evil here. Anyone working with TLS is either writing an
operating system or doing it wrong.

As long as we are talking about a closed system that works exclusively
on this
fiber based concurrency model, I completely agree with you (fiber
local storage
would be fine, though).

But we have the "unfortunate" situation that the language is not an
ecosystem. There are many C libraries that do thread-specific things
in one way
or another, or worse, make use of ordinary global variables without any
protection against data races, and we simply cannot ignore that.

One solution (that seems entirely reasonable to me) is to make the
droutines (i.e. "goroutines") pure. Then the TLS problem goes away. Of
course, then I/O isn't possible either, but perhaps a solution can be
found for that.

I/O is crucial of course, but there are also a lot of other important and inherently impure things such as message passing. I think such a restriction would go way too far. Both fiber and task local storage can also be very useful at times, so it would be a pity to rule them out completely.

You'd also usually have the whole application running on "droutines" and not simply use them as a local tool for occasional parallelism needs. This is especially true for any kind of server application. So effectively such a limitation may in practice end up as a limitation of the entire language.

Reply via email to