A data sharing problem happens when two tasks access the same memory location, and the behavior of the program depends on the order of accesses. This group of topics describes two common data access patterns - incidental sharing and independent updates - that result in data sharing problems that are relatively easy to fix. The fixes are described in Problem Solving Strategies.
In a serial program, the order of the operations during program execution are known. However, when code executes as multiple parallel tasks, an operation can execute before, after, or simultaneously with an operation in the other task. For example, when parallel tasks access or modify a shared memory location, data sharing problems can occur.