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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/cml/doc/ML-Doc/lib/multicast.mldoc
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (view) (download)
Original Path: sml/branches/SMLNJ/src/cml/doc/ML-Doc/lib/multicast.mldoc

1 : monnier 7 <!-- multicast.mldoc -->
2 :    
3 :     <!DOCTYPE ML-DOC SYSTEM>
4 :    
5 :     <COPYRIGHT OWNER="AT&AMP;T Research" YEAR=1997>
6 :     <VERSION VERID="1.0" YEAR=1997 MONTH=1 DAY=29>
7 :     <TITLE>The Multicast structure</TITLE>
8 :    
9 :     <SECT>
10 :     <HEAD>The <CD/Multicast/ structure</HEAD>
11 :    
12 :     <PP>
13 :     Multicast channels provide a mechanism for broadcasting a stream of
14 :     messages to a collection of threads.
15 :     Threads receive multicast messages via an <EM/output port/; each port
16 :     receives its own copy of every message sent since the port was
17 :     created.
18 :     Multicast channels are particularly useful for communicating with a dynamically
19 :     varying group of threads, since the sender does not need to know
20 :     how many threads are listening.
21 :    
22 :     <STRUCTURE STRID="Multicast">
23 :     <SIGBODY SIGID="MULTICAST" FILE=MULTICAST-SIG>
24 :     <SPEC>
25 :     <TYPE><TYPARAM>'a<ID>event<TY>'a CML.event
26 :     <SPEC>
27 :     <TYPE><TYPARAM>'a<ID>mchan
28 :     <COMMENT>
29 :     This is the type constructor for asynchronous multicast channels.
30 :     <SPEC>
31 :     <TYPE><TYPARAM>'a<ID>port
32 :     <COMMENT>
33 :     This is the type constructor for output ports on an
34 :     asynchronous multicast channels.
35 :     <SPEC>
36 :     <VAL>mChannel<TY>unit -> 'a mchan
37 :     <COMMENT>
38 :     <PROTOTY>
39 :     mChannel <ARG/()/
40 :     </PROTOTY>
41 :     creates a new multicast channel.
42 :     <SPEC>
43 :     <VAL>port<TY>'a mchan -> 'a port
44 :     <COMMENT>
45 :     <PROTOTY>
46 :     port <ARG/mc/
47 :     </PROTOTY>
48 :     creates a new output port on the channel <ARG/mc/.
49 :     The port receives those messages sent after it is created.
50 :     <SPEC>
51 :     <VAL>copy<TY>'a port -> 'a port
52 :     <COMMENT>
53 :     <PROTOTY>
54 :     copy <ARG/p/
55 :     </PROTOTY>
56 :     creates a new output port on a channel that has the same state as the
57 :     port <ARG/p/.
58 :     I.e., the stream of messages seen on the two ports will
59 :     be the same.
60 :     This is useful when two threads need to see the same stream of
61 :     messages.
62 :     NOTE: if two (or more) independent threads are reading from <ARG/p/
63 :     at the time that <VALREF NOLINK/copy/ operation is performed, then
64 :     it may not be accurate.
65 :     <SPEC>
66 :     <VAL>recv<TY>'a port -> 'a
67 :     <COMMENT>
68 :     <PROTOTY>
69 :     recv <ARG/p/
70 :     </PROTOTY>
71 :     gets the next message from the port <ARG/p/.
72 :     The calling thread is blocked until there is a message available.
73 :     <SPEC>
74 :     <VAL>recvEvt<TY>'a port -> 'a event
75 :     <COMMENT>
76 :     <PROTOTY>
77 :     recvEvt <ARG/p/
78 :     </PROTOTY>
79 :     creates an event value that represents the <VALREF/recv/ operation
80 :     on the port <ARG/p/.
81 :     <SPEC>
82 :     <VAL>multicast<TY>('a mchan * 'a) -> unit
83 :     <COMMENT>
84 :     <PROTOTY>
85 :     multicast (<ARG/mc/, <ARG/v/)
86 :     </PROTOTY>
87 :     multicasts the value <ARG/v/ on the channel <ARG/mc/.
88 :     This is a nonblocking operation.
89 :     <!-- optional SEEALSO; uncomment to use -->
90 :     <!-- <SEEALSO> -->
91 :     <!-- non-empty list of XREFS here -->
92 :     <!-- </SEEALSO> -->
93 :     </STRUCTURE>

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0