I want to save memory by converting an existing 32 bit counter to a 16 bit counter. This counter is atomically incremented/decremented. If I do this:
- What instructions do I use for atomic_inc(uint16_t x) on x86/x86_64?
- Is this reliable in multi-processor x86/x86_64 machines?
- Is there a performance penalty to pay on any of these architectures for doing this?
- If yes for (3), what's the expected performance penalty?
Thanks for your comments!