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 endMLton'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
-
You can import the CML Library into an MLB file with:
MLB file Description $(SML_LIB)/cml/cml.mlb -
If you are porting a project from SML/NJ's CompilationManager to MLton's ML Basis system using cm2mlb, note that the following map is included by default:
$cml/cml.cm $(SML_LIB)/cml/cml.mlb
This will automatically convert a $cml/cml.cm import in an input .cm file into a $(SML_LIB)/cml/cml.mlb import in the output .mlb file.