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 /sml/trunk/src/cml/doc/ML-Doc/lib/multicast.mldoc
ViewVC logotype

View of /sml/trunk/src/cml/doc/ML-Doc/lib/multicast.mldoc

Parent Directory Parent Directory | Revision Log Revision Log

Revision 10 - (download) (annotate)
Sun Jan 18 01:01:29 1998 UTC (21 years, 7 months ago)
Original Path: sml/branches/SMLNJ/src/cml/doc/ML-Doc/lib/multicast.mldoc
File size: 2978 byte(s)
This commit was manufactured by cvs2svn to create branch 'SMLNJ'.
<!-- multicast.mldoc -->


<TITLE>The Multicast structure</TITLE>

<HEAD>The <CD/Multicast/ structure</HEAD>

Multicast channels provide a mechanism for broadcasting a stream of
messages to a collection of threads.
Threads receive multicast messages via an <EM/output port/; each port
receives its own copy of every message sent since the port was
Multicast channels are particularly useful for communicating with a dynamically
varying group of threads, since the sender does not need to know
how many threads are listening.

      <TYPE><TYPARAM>'a<ID>event<TY>'a CML.event
          This is the type constructor for asynchronous multicast channels.
          This is the type constructor for output ports on an
	  asynchronous multicast channels.
      <VAL>mChannel<TY>unit -> 'a mchan
          mChannel <ARG/()/
          creates a new multicast channel.
      <VAL>port<TY>'a mchan -> 'a port
          port <ARG/mc/
          creates a new output port on the channel <ARG/mc/.
	  The port receives those messages sent after it is created.
      <VAL>copy<TY>'a port -> 'a port
          copy <ARG/p/
          creates a new output port on a channel that has the same state as the
	  port <ARG/p/.
	  I.e., the stream of messages seen on the two ports will
	  be the same.
	  This is useful when two threads need to see the same stream of
	  NOTE: if two (or more) independent threads are reading from <ARG/p/
	  at the time that <VALREF NOLINK/copy/ operation is performed, then
	  it may not be accurate.
      <VAL>recv<TY>'a port -> 'a
          recv <ARG/p/
          gets the next message from the port <ARG/p/.
	  The calling thread is blocked until there is a message available.
      <VAL>recvEvt<TY>'a port -> 'a event
          recvEvt <ARG/p/
	  creates an event value that represents the <VALREF/recv/ operation
	  on the port <ARG/p/.
      <VAL>multicast<TY>('a mchan * 'a) -> unit
          multicast (<ARG/mc/, <ARG/v/)
          multicasts the value <ARG/v/ on the channel <ARG/mc/.
	  This is a nonblocking operation.
<!-- optional SEEALSO; uncomment to use     -->
<!-- <SEEALSO>    -->
<!--   non-empty list of XREFS here   -->
<!-- </SEEALSO>    -->

ViewVC Help
Powered by ViewVC 1.0.0