Concurrent ML signature

signature CML = 
sig 
    type 'a event
    val never     : 'a event
    val alwaysEvt : 'a -> 'a event
    val wrap        : ('a event * ('a -> 'b)) -> 'b event
    val wrapHandler : ('a event * (exn -> 'a)) -> 'a event
    val guard    : (unit -> 'a event) -> 'a event
    val withNack : (unit event -> 'a event) -> 'a event
    val choose : 'a event list -> 'a event
    val sync : 'a event -> 'a
    val select : 'a event list -> 'a

    type thread_id
    val getTid : unit -> thread_id
    val sameTid    : (thread_id * thread_id) -> bool
    val compareTid : (thread_id * thread_id) -> order
    val hashTid    : thread_id -> word
    val tidToString : thread_id -> string
    val spawnc : ('a -> unit) -> 'a -> thread_id
    val spawn  : (unit -> unit) -> thread_id
    val exit : unit -> 'a
    val joinEvt : thread_id -> unit event
    val yield : unit -> unit	

    type 'a chan
    val channel : unit -> 'a chan
    val sameChannel : ('a chan * 'a chan) -> bool
    val send : ('a chan * 'a) -> unit
    val recv : 'a chan -> 'a
    val sendEvt  : ('a chan * 'a) -> unit event
    val recvEvt  : 'a chan -> 'a event
    val sendPoll : ('a chan * 'a) -> bool
    val recvPoll : 'a chan -> 'a option

    val timeOutEvt : Time.time -> unit event
    val atTimeEvt : Time.time -> unit event

end

Back to COS 441 front page | Course Newsgroup | Assignments