Previous Contents Next

5.12   Module shutdown: distributed termination

This module implements functions that control the termination of a distributed computation: when a program has completed, it is often suitable for all the participating runtimes to terminate in concert. Distributed termination is a difficult problem in general. In this release, it relies on failure detection and requires specific support from the implementation.

The shutdown protocol requires every participating runtime to register beforehand, usually at the beginning of every program; then, any participant may trigger the global termination.

Current limitations: In this release, some runtimes may report errors such as broken connections or even deadlock instead of exiting silently as a result of a shutdown.
val ready: <> -> <>
shutdown.ready() registers the local runtime as a potential participant to a global shutdown that would occur after it returns.
val global: <> 
shutdown.global() causes all registered runtimes to exit.
val local: <>
shutdown.local() causes the current runtime to exit at once. The consequences for the other runtimes is not specified.

Previous Contents Next