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

SCM Repository

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

Diff of /sml/trunk/src/cml/doc/ML-Doc/cml.mldoc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 843, Tue Jun 19 21:53:04 2001 UTC revision 844, Wed Jun 20 20:39:15 2001 UTC
# Line 84  Line 84 
84            <PROTOTY>            <PROTOTY>
85            sameTid (<ARG/tid1/, <ARG/tid2/)            sameTid (<ARG/tid1/, <ARG/tid2/)
86            </PROTOTY>            </PROTOTY>
87            returns true, if the two thread IDs are the same ID.            returns <CD/true/, if the two thread IDs are the same ID.
88      <SPEC>      <SPEC>
89        <VAL>compareTid<TY>(thread_id * thread_id) -> order        <VAL>compareTid<TY>(thread_id * thread_id) -> order
90          <COMMENT>          <COMMENT>
# Line 118  Line 118 
118            creates an event value for synchronizing on the termination of            creates an event value for synchronizing on the termination of
119            the thread with the ID <ARG/tid/.            the thread with the ID <ARG/tid/.
120            There are three ways that a thread may terminate: the function that            There are three ways that a thread may terminate: the function that
121            was passed to <VALREF/spawn/ may return; it may call the <VALREF/exit/            was passed to <VALREF/spawn/ (or <VALREF/spawnc/) may return; it
122            function, or it may have an uncaught exception.            may call the <VALREF/exit/ function, or it may have an uncaught
123              exception.
124            Note that <VALREF NOLINK/joinEvt/ does not distinguish between these            Note that <VALREF NOLINK/joinEvt/ does not distinguish between these
125            cases; it also does not become enabled if the named thread deadlocks            cases; it also does not become enabled if the named thread deadlocks
126            (even if it is garbage collected).            (even if it is garbage collected).
# Line 136  Line 137 
137            <PROTOTY>            <PROTOTY>
138            sameChannel (<ARG/ch1/, <ARG/ch2/)            sameChannel (<ARG/ch1/, <ARG/ch2/)
139            </PROTOTY>            </PROTOTY>
140            returns true, if the two channels are the same channel.            returns <CD/true/, if the two channels are the same channel.
141      <SPEC>      <SPEC>
142        <VAL>send<TY>('a chan * 'a) -> unit        <VAL>send<TY>('a chan * 'a) -> unit
143          <COMMENT>          <COMMENT>
144            <PROTOTY>            <PROTOTY>
145              send (<ARG/ch/, <ARG/a/)              send (<ARG/ch/, <ARG/msg/)
146            </PROTOTY>            </PROTOTY>
147            sends the message <ARG/a/ on the synchronous channel <ARG/ch/.            sends the message <ARG/msg/ on the synchronous channel <ARG/ch/.
148            This operation blocks the calling thread until there is another            This operation blocks the calling thread until there is another
149            thread attempting a <VALREF/recv/ operation on the channel <ARG/ch/.            thread attempting to receive a message from the channel <ARG/ch/,
150              at which point the receiving thread gets the message and both threads
151              continue execution.
152      <SPEC>      <SPEC>
153        <VAL>recv<TY>'a chan -> 'a        <VAL>recv<TY>'a chan -> 'a
154          <COMMENT>          <COMMENT>
# Line 154  Line 157 
157            </PROTOTY>            </PROTOTY>
158            receives a message from the channel <ARG/ch/.            receives a message from the channel <ARG/ch/.
159            This operation blocks the calling thread until there is another            This operation blocks the calling thread until there is another
160            thread attempting a <VALREF/send/ operation on the channel <ARG/ch/.            thread attempting to send a message on the channel <ARG/ch/,
161              at which point both threads continue execution.
162      <SPEC>      <SPEC>
163        <VAL>sendEvt<TY>('a chan * 'a) -> unit event        <VAL>sendEvt<TY>('a chan * 'a) -> unit event
164        <VAL>recvEvt<TY>'a chan -> 'a event        <VAL>recvEvt<TY>'a chan -> 'a event
# Line 166  Line 170 
170        <VAL>sendPoll<TY>('a chan * 'a) -> bool        <VAL>sendPoll<TY>('a chan * 'a) -> bool
171          <COMMENT>          <COMMENT>
172            <PROTOTY>            <PROTOTY>
173              send (<ARG/ch/, <ARG/a/)              sendPoll (<ARG/ch/, <ARG/msg/)
174            </PROTOTY>            </PROTOTY>
175            attempts to send the message <ARG/a/ on the synchronous channel <ARG/ch/.            attempts to send the message <ARG/msg/ on the synchronous channel <ARG/ch/.
176            If this operation can complete without blocking the calling thread, then            If this operation can complete without blocking the calling thread, then
177            the message is sent and <CD/true/ is returned.            the message is sent and <CD/true/ is returned.
178            Otherwise, no communication is preformed and <CD/false/ is returned.            Otherwise, no communication is preformed and <CD/false/ is returned.
# Line 200  Line 204 
204        <VAL>wrapHandler<TY>('a event * (exn -> 'a event)) -> 'a event        <VAL>wrapHandler<TY>('a event * (exn -> 'a event)) -> 'a event
205          <COMMENT>          <COMMENT>
206            <PROTOTY>            <PROTOTY>
207            wrapHandler (<ARG/ev/, <ARG/f/)            wrapHandler (<ARG/ev/, <ARG/h/)
208            </PROTOTY>            </PROTOTY>
209            wraps the exception handler function <ARG/f/ around the event            wraps the exception handler function <ARG/h/ around the event
210            value <ARG/ev/.            value <ARG/ev/.
211            If, during execution of some post-synchronization action in            If, during execution of some post-synchronization action in
212            <ARG/ev/, an exception is raised, it will be caught and passed            <ARG/ev/, an exception is raised, it will be caught and passed
213            to <ARG/f/.            to <ARG/h/.
214            Nesting of handlers works as would be expected: the innermost            Nesting of handlers works as would be expected: the innermost
215            handler is the one invoked.            handler is the first one invoked.
216            Note that exceptions raised in the pre-synchronization actions in            Note that exceptions raised in the pre-synchronization actions in
217            <ARG/ev/ (i.e., actions defined by <VALREF/guard/ and <VALREF/withNack/)            <ARG/ev/ (i.e., actions defined by <VALREF/guard/ and <VALREF/withNack/)
218            are not handled by <ARG/f/.            are not handled by <ARG/h/.
219      <SPEC>      <SPEC>
220        <VAL>guard<TY>(unit -> 'a event) -> 'a event        <VAL>guard<TY>(unit -> 'a event) -> 'a event
221          <COMMENT>          <COMMENT>
222            <PROTOTY>            <PROTOTY>
223            guard <ARG/f/            guard <ARG/g/
224            </PROTOTY>            </PROTOTY>
225            creates <IT>delayed</IT> event value from the function <ARG/f/.            creates a <IT>delayed</IT> event value from the function <ARG/g/.
226            When the resulting event value is synchronized on, the function            When the resulting event value is synchronized on, the function
227            <ARG/f/ will be evaluated and the resulting event value will be            <ARG/g/ will be evaluated and the resulting event value will be
228            used in its place in the synchronization.            used in its place in the synchronization.
229            This provides a mechanism for implementing pre-synchronization            This provides a mechanism for implementing pre-synchronization
230            actions, such as sending a request to a server.            actions, such as sending a request to a server.
# Line 228  Line 232 
232        <VAL>withNack<TY>(unit event -> 'a event) -> 'a event        <VAL>withNack<TY>(unit event -> 'a event) -> 'a event
233          <COMMENT>          <COMMENT>
234            <PROTOTY>            <PROTOTY>
235            withNack <ARG/f/            withNack <ARG/g/
236            </PROTOTY>            </PROTOTY>
237            creates <IT>delayed</IT> event value from the function <ARG/f/.            creates a <IT>delayed</IT> event value from the function <ARG/g/.
238            As in the case of <VALREF/guard/, the function <ARG/f/ will be evaluated            As in the case of <VALREF/guard/, the function <ARG/g/ will be evaluated
239            at synchronization time and the resulting event value will be            at synchronization time and the resulting event value will be
240            used in its place in the synchronization.            used in its place in the synchronization.
241            Furthermore, when <ARG/f/ is evaluated, it is passed a <IT>negative            Furthermore, when <ARG/g/ is evaluated, it is passed a <IT>negative
242            acknowledgement</IT> event as an argument.            acknowledgement</IT> event as an argument.
243            If the event value that is returned from the evaluation of <ARG/f/            This negative acknowledgement event is enabled in the case where
244            is <EM/not/ chosen in the synchronization, then the negative            some other event involved in the synchronization is chosen instead
245            event will be enabled.            of the one produced by <ARG/g/.
246            This provides a mechanism for informing servers that a client has            The <VALREF NOLINK/withNack/ combinator provides a mechanism for
247            aborted a transaction.            informing servers that a client has aborted a transaction.
248      <SPEC>      <SPEC>
249        <VAL>choose<TY>'a event list -> 'a event        <VAL>choose<TY>'a event list -> 'a event
250          <COMMENT>          <COMMENT>
251            <PROTOTY>            <PROTOTY>
252            choose <ARG/l/            choose <ARG/evs/
253            </PROTOTY>            </PROTOTY>
254            constructs an event value that represents the non-deterministic            constructs an event value that represents the non-deterministic
255            choice of the events in the list <ARG/l/.            choice of the events in the list <ARG/evs/.
256      <SPEC>      <SPEC>
257        <VAL>sync<TY>'a event -> 'a        <VAL>sync<TY>'a event -> 'a
258          <COMMENT>          <COMMENT>
# Line 262  Line 266 
266            <PROTOTY>            <PROTOTY>
267            select <ARG/evs/            select <ARG/evs/
268            </PROTOTY>            </PROTOTY>
269            synchronizes on the choice of a list of event values.            synchronizes on the non-deterministic choice of the events in the
270            This is semantically equivalant to:            list <ARG/evs/.
271              It is semantically equivalant to:
272            <CODE>            <CODE>
273              <VALREF/sync/ (<VALREF/choose/ <ARG/evs/)              <VALREF/sync/ (<VALREF/choose/ <ARG/evs/)
274            </CODE>            </CODE>
# Line 283  Line 288 
288        <VAL>alwaysEvt<TY>'a -> 'a event        <VAL>alwaysEvt<TY>'a -> 'a event
289          <COMMENT>          <COMMENT>
290            <PROTOTY>            <PROTOTY>
291            alwaysEvt <ARG/a/            alwaysEvt <ARG/x/
292            </PROTOTY>            </PROTOTY>
293            creates an event value that is always enabled, and that returns            creates an event value that is always enabled, and that returns
294            the value <ARG/a/ upon synchronization.            the value <ARG/x/ upon synchronization.
295      <SPEC>      <SPEC>
296        <VAL>timeOutEvt<TY>Time.time -> unit event        <VAL>timeOutEvt<TY>Time.time -> unit event
297          <COMMENT>          <COMMENT>

Legend:
Removed from v.843  
changed lines
  Added in v.844

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