I'm confused about how to choose the most effective way to synchronize multi threads. Supposed we have an integer value i to synchronize.
- 1-Write/1-Read : just simply ignore it or add volatile before i?
- 1-Write/N-Read : just simply ignore it or add volatile before i?
- N-Write/1-Read : Interlocked is the best way.
- N-Write/1-Read : Interlocked is the best way.
Should i use volatile, Interlocked or lock?