The devx article 8 Simple Rules for Designing Threaded Applications has some good advice:
- Be sure you identify truly independent computations.
- Implement concurrency at highest level possible.
- Plan early for scalability to take advantage of increasing numbers of cores.
- Make use of thread-safe libraries wherever possible.
- Use the right threading model.
- Never assume a particular order of execution.
- Use thread-local storage whenever possible; associate locks to specific data, if needed.
- Don’t be afraid to change the algorithm for a better chance of concurrency.