Variable modified by different threads.
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Tue Dec 3 17:47:37 UTC 2024
On 04/12/2024 6:37 AM, Nick Treleaven wrote:
> If you use it to indicate anything other than the variable can only
> be accessed/mutated via atomic operations, you are at best lieing to
> yourself about the native memory model.
>
> All memory is owned by the process, until proven otherwise. Which is
> the exact opposite of what |shared| implies.
>
> |shared| - shared (i.e. accessible) across threads.
That is already true. 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.
More information about the Digitalmars-d-learn
mailing list