Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /cml/trunk/src/core-cml/barrier-sig.sml
ViewVC logotype

View of /cml/trunk/src/core-cml/barrier-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 3572 - (download) (annotate)
Fri Feb 18 17:42:41 2011 UTC (8 years, 6 months ago) by jhr
File size: 877 byte(s)
  Added barriers to CML
(* barrier-sig.sml
 * COPYRIGHT (c) 2011 The Fellowship of SML/NJ (http://www.smlnj.org)
 * All rights reserved.
 * Support for barrier synchronization with global state.  This mechanism
 * is inspired by the similar CHP mechanism (http://www.cs.kent.ac.uk/projects/ofa/chp/).

signature BARRIER =

    type 'a barrier
    type 'a enrolled_barrier

  (* create a new barrier.  The first argument is the update function that
   * is applied to the global state whenever a barrier synchronization occurs.
   * The second argument is the initial global state.
    val barrier : ('a -> 'a) -> 'a -> 'a barrier

  (* enroll in a barrier *)
    val enroll : 'a barrier -> 'a enrolled_barrier

  (* synchronize on a barrier *)
    val wait : 'a enrolled_barrier -> 'a

  (* resign from an enrolled barrier *)
    val resign : 'a enrolled_barrier -> unit


ViewVC Help
Powered by ViewVC 1.0.0