Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Having completed this chapter, you should have an appreciation of some of the issues that need to be considered when writing synchronization code. It is important to consider both the memory ordering observed by other threads and the possibility that a thread might be descheduled at any point.
Correct memory ordering needs to be enforced to ensure that memory operations become visible to other threads in the appropriate order. Failure to do this will result in other threads picking up stale or invalid values.