[Issue 10165] New: No syntax to create thread-local shared variables

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 24 14:22:40 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10165

           Summary: No syntax to create thread-local shared variables
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: pull
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: GenericNPC at gmail.com


--- Comment #0 from IdanArye <GenericNPC at gmail.com> 2013-05-24 14:22:39 PDT ---
Writing

    class Foo
    {
        shared Foo a;
        static Foo b;
        static shared Foo c;
    }

`a` is an instance-local shared reference. `b` is a thread-local not-shared
reference. You would expect that `c` would be thread-local shared reference -
but instead it's a process-global shared reference.

I do not suggest changing the behaviour of `static shared` - it is the syntax
for process-global shared variables by design, and changing it will break too
much code. But we do need a way to create thread-local shared variables.

I've implemented a library solution, but I believe this problem requires a
compiler solution that's why the component field is "dmd".

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list