The Asynchronous C++ Parallel Programming Model
The Asynchronous C++ Parallel Programming Model
In my words, use future as return value and chain dependencies by chaining futures.
Guidelines to write efficient application.
- parallel as much as humanly possible
- 4 aspects that restrict parallelism(SLOW)
- Starvation: insufficient concurrent workload to maintain high utilization of resources.
- Latency: Time-distance delay of remote resources access and services.
- Overhead: Work for management of parallel actions and resources on critical path which are not necessary in sequential program.
- Waiting: Delay due to lack of availability of oversubscribed shared resource(contention resolution).
- 4 aspects that restrict parallelism(SLOW)
- use programming environment that embraces SLOW
- allow for your grain size to be variable
- oversubscribe and balance adaptively
The challenge
- Expose asynchrony but without exposing additional concurrency
- Make data dependency explicit, hide notion of thread/communication
- Provide manageable paradigms for handling parallelism
Proposed solutions
- Asynchronous programming model
- objects interacting with async function calls(remote calls are sent as active messages)
- futures are used to represent data dependencies in async execution flow. benefits:
- synchronized with producer threads transparently
- no notion of threads
- allows for composition of async operations
- turns concurrency into parallelism
Async communication
What this talk is mainly about? I think the summary will be : use future as your function return value and chain them to express dependencies.