core.stdc.stdatomic

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Wed Nov 15 06:49:18 UTC 2023


On 15/11/2023 7:32 PM, Walter Bright wrote:
> On 11/14/2023 7:49 PM, Richard (Rikki) Andrew Cattermole wrote:
>> So it is timing based, you have set points which act as 
>> synchronization events and then everything after it must work exactly 
>> the same on each core. This is VERY HARD!
> 
> Everything I've read about writing correct synchronization says it's not 
> about timing, it's about sequencing.
> 
> For example,
> https://www.amazon.com/C-Concurrency-Action-Anthony-Williams/dp/1617294691
> 
> or maybe you and I are just misunderstanding terms.
> 
> For example, fences. Fences enforce memory-ordering constraints, not 
> timing. Happens-before and synchronizes-with are sequencing, not timing.

You have understood the simplified parts of the problem.

The problem is when concurrency is in action, multiple cores operating 
on same memory in same time units. You reach a shifting sands feeling 
where multiple facts can be true at the same time on different cores and 
it can be completely contradictory. Memory can be mapped on one, and not 
on another.

Did I mention I have grey hair because of this?

This might be a reason why I have strong opinions about D foundations 
such as symbols since that experience ;)

Also:

https://github.com/dlang/dmd/pull/15816


More information about the Digitalmars-d mailing list