First of all, "const" is usually used as just a bridge between immutable and plain types. You should probably use "immutable" there.

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.

Reply via email to