On Sunday, 26 March 2023 at 18:25:54 UTC, Richard (Rikki) Andrew Cattermole wrote:
Having TLS by default is actually quite desirable if you like your code to be safe without having to do anything extra.

As soon as you go into global to the process memory, you are responsible for synchronization. Ensuring that the state is what you want it to be.

Keep in mind that threads didn't exist when C was created. They could not change their approach without breaking everyone's code. So what they do is totally irrelevant unless its 1980.

I think its the correct way around. You can't accidentally cause memory safety issues. You must explicitly opt-into the ability to mess up your programs state.

It's never desirable to have it by default, the consensus should be: let the developer make the choice, currently the consensus is to punish the developer who want to make the choice

Golang doesn't even have thread local storage, yet they do very well

D doesn't have coroutines, D doesn't do anything special, it just forces you to uglyfy your code to opt out

``__gshared`` is ugly to write, ugly to read, there must be a better solution


  • Why are globals ... ryuukk_ via Digitalmars-d-learn
    • Re: Why are... ryuukk_ via Digitalmars-d-learn
    • Re: Why are... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: Why... ryuukk_ via Digitalmars-d-learn
        • Re:... Nick Treleaven via Digitalmars-d-learn
          • ... ryuukk_ via Digitalmars-d-learn
      • Re: Why... IGotD- via Digitalmars-d-learn
      • Re: Why... IGotD- via Digitalmars-d-learn
        • Re:... Guillaume Piolat via Digitalmars-d-learn
    • Re: Why are... Nick Treleaven via Digitalmars-d-learn
      • Re: Why... ryuukk_ via Digitalmars-d-learn
        • Re:... Nick Treleaven via Digitalmars-d-learn
        • Re:... Nick Treleaven via Digitalmars-d-learn
          • ... ryuukk_ via Digitalmars-d-learn

Reply via email to