• In no way guess a particular order of execution – thread execution order cannot be established and restricted by the OS scheduler. You cannot predict the sequence of threads flowing from one execution to the next, not even what thread comes next.
• If possible, use thread-local storage – to keep coordination to a minimum, use exclusive memory location.
• For better concurrency, you can change the algorithm – when programmers are given 2 or more choices of algorithm, they can rely on the asymptotic order of execution because it is almost always that the theoretic metric is connected with an application’s operation.
Following these rules, it will be easier to create strong concurrent solutions with less threading problems.
