I need a small counter (up to 10).
I don’t want to use atomic (because the overhead of atomic).
Which type can i use for this?
I might doing premature optimization , but unfortunately I cannot simulate the full production env right now (multi-threading env).
Running on Ubuntu x86
Atomic is the right thing to use and the fastest way to do it. If your architecture can do atomic updates in a single instruction then that’s how the atomic types will be implemented.