Now that we have covered the basics of processes and threads and the ways in which they communicate, it is time to see what we can do with them.
Here are some of the rules I use when building systems:
- Rule 1: Keep tasks that have a lot of interaction together: It is important to minimize overheads by keeping closely inter-operating threads together in one process.
- Rule 2: Don't put all your threads in one basket: On the other hand, try and keep components with limited interaction in separate processes, in the interests of resilience and modularity.
- Rule 3: Don't mix critical and noncritical threads in the same process: This is an amplification of Rule 2: the critical part of the system, which might be a machine control ...