On 04/12/2024 11:20 AM, Ali Çehreli wrote:
On 12/3/24 9:47 AM, Richard (Rikki) Andrew Cattermole wrote:
 > On 04/12/2024 6:37 AM, Nick Treleaven wrote:

 >> |shared| - shared (i.e. accessible) across threads.
 >
 > That is already true.

That conflicts with my knowledge of data being thread-local by default in D.

 > You don't need a type qualifier to tell you that.
 >
 > What you need the compiler assistance for, is to tell you that it is NOT
 > accessible to multiple threads.

I think you are objecting to D's thread-local by default decision but I'm not sure. :)

Ali

You are thinking of globals, which are by default TLS yes.
No objection to that here.

What owned by a thread means is that a pointer is guaranteed to only be accessible by that thread. I.e. the cpu will segfault if you try to access it from another thread.

Current CPU's don't offer this protection, so it would have to be proven by the compiler using language features instead.

    • Re: Variabl... Ali Çehreli via Digitalmars-d-learn
      • Re: Var... Andy Valencia via Digitalmars-d-learn
      • Re: Var... Salih Dincer via Digitalmars-d-learn
        • Re:... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
          • ... Salih Dincer via Digitalmars-d-learn
            • ... Ali Çehreli via Digitalmars-d-learn
            • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
              • ... Nick Treleaven via Digitalmars-d-learn
              • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
              • ... Ali Çehreli via Digitalmars-d-learn
              • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
              • ... Andy Valencia via Digitalmars-d-learn
  • Re: Variable mod... Salih Dincer via Digitalmars-d-learn

Reply via email to