Channels are a typed conduit through which you can send and receive values with the channel send
and recv
functions.
(* Send to channel ch *)
- send (ch, v);
(* Receive from ch and give it a name v *)
- val v = recv ch;
Note that send
is a blocking operation. It will not return until another thread attempts to recv
.
(* examples/chan.sml *)