Glossary · Automation software engineering and architecture
Mutual exclusion
Also known as: Mutex principle
German: Gegenseitiger Ausschluss
In concurrent programming, mutual exclusion is the property that at most one thread or process executes a critical section or uses a shared resource at any time.
- Software engineering
In one sentence
Mutual exclusion ensures that at most one thread or process uses a shared resource or runs a critical section at any time.
Example
Mutual exclusion on the recipe memory ensures that the HMI cannot overwrite a recipe while the PLC task is loading it into the batch sequence.
How it applies
- Engineering: Mutual exclusion prevents a Race condition on shared data. It is implemented with locks such as a Mutex, with a Semaphore, by disabling interrupts for very short sections, or by atomic operations.
- Design: Too much mutual exclusion reduces parallelism and can cause Deadlock or Starvation; designers keep critical sections short and few.
- Documentation: Design documentation should name each shared resource and how exclusive access is guaranteed, so reviewers and maintainers do not break it with later changes.
Mutual exclusion vs. mutual exclusion zone
In software, mutual exclusion concerns access to data or code. In machine coordination, a Mutual exclusion zone is a physical area that only one robot or machine may occupy at a time. The logic is similar, but the zone concerns physical movement and can have safety implications.