Structure of Message-Passing Programs
- Message-passing programs are often written using the asynchronous or loosely synchronous paradigms.
- In the asynchronous paradigm, all concurrent tasks execute asynchronously.
- However, such programs can be harder and can have non-deterministic behavior due to race conditions.
- Loosely synchronous programs are a good compromise between two extremes.
- In such programs, tasks or subsets of tasks synchronize to perform interactions.
- However, between these interactions, tasks execute completely asynchronously.
- Most message-passing programs are written using the single program multiple data (SPMD).
- SPMD programs can be loosely synchronous or completely asynchronous.