MLton 20051202 ConcurrentML
Home  Index  
[WWW]Concurrent ML is an SML concurrency library based on synchronous message passing. MLton has an initial port of CML from SML/NJ, but is missing a thread-safe wrapper around the Basis Library and event-based equivalents to IO and OS functions.

All of the core CML functionality is present.

structure CML: CML
structure SyncVar: SYNC_VAR
structure Mailbox: MAILBOX
structure Multicast: MULTICAST
structure SimpleRPC: SIMPLE_RPC
structure RunCML: RUN_CML

The RUN_CML signature is minimal.

signature RUN_CML =
   sig
      val isRunning: unit -> bool
      val doit: (unit -> unit) * Time.time option -> OS.Process.status
      val shutdown: OS.Process.status -> 'a
   end
MLton's RunCML structure does not include all of the cleanup and logging operations of SML/NJ's RunCML structure. However, the implementation does include the CML.timeOutEvt and CML.atTimeEvt functions, and a preemptive scheduler that knows to sleep when there are no ready threads and some threads blocked on time events.

Because MLton does not wrap the Basis Library for CML, the "right" way to call a Basis Library function that is stateful is to wrap the call with MLton.Thread.atomically.

Usage

Also see


Last edited on 2005-12-02 03:33:39 by StephenWeeks.