Skip to content

Atomic exercise DOES NOT race on my machine #353

@chavid

Description

@chavid

@hageboeck @sponce @bernhardmgruber

I suspect the -O2 compiling option (with g++ 11.3. ) make that for (int i = 0; i < 100; ++i) { a++; } is some howreplaced with a+=100 ... Quite simple to change in Makefile. How to do it in CMakeLists.txt ?

I also needed to move up the code to 10000 tries (instead of 1000), and the main function to 1000 increments (instead of 100) before I start to see racing conditions.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions