OK, this is a tough one. It might be spread across several boards, too, so I'll just post it here, so moderators can move it if they think it necessary.
Anyway, the question is atomic increment and decrement operations.
Windows provides two such functions for signed 32-bit values, which obviously is less than ideal since I want to use 8 to 64 bits and unsigned, as well.
The other option is to use VS specific memory barriers to carry out atomic operations, but then it would be locked to the VS compiler.
What way should I take? Any other solutions?
I'm merely looking for a way to increment and decrement a value in a thread-safe manner.