As for sharing, immutable variables are implicitly shared, since they can never change (const variables CAN change somewhere else in the program). Your globalVar gets copied to each of the thread's heaps though. If you change it in one, you won't see the difference in the other.
First of all, "const" is usually used as just a bridge between
immutable and plain types. You should probably use "immutable"
there.
- Trying to understand how "shared" works in D Sparsh Mittal
- Re: Trying to understand how "shared" works i... Matej Nanut
- Re: Trying to understand how "shared" wor... Sparsh Mittal
