Changes between Version 8 and Version 9 of Language


Ignore:
Timestamp:
05/18/23 10:43:55 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language

    v8 v9  
    377377There is no guarantee that execution of `stmt` will continue atomically if it contains more than one atomic action, i.e., other processes may be scheduled.
    378378
    379 Examples:
     379==== Example
    380380
    381381{{{
     
    385385The execution of `s--` is guaranteed to take place in an environment in which `s` is positive.
    386386
     387==== Example
     388
    387389{{{
    388390$when (s>0) { s--; t++; }
     
    393395$when (s>0) s--; t++;
    394396}}}
    395 To make the entire statement atomic, one must use an `$atomic` statement.
    396 
    397 {{{
    398 $when (s>0) $when (t>0) x=y*t;
    399 }}}
    400 This blocks until both `x` and `t` are positive then executes the assignment in that state.
    401 It is equivalent to
    402 {{{
    403 $when (s>0 && t>0) x=y*t;
    404 }}}
     397To make the entire statement atomic, one must use an `$atomic` statement; see the following example.
     398
     399==== Example
    405400
    406401The following statements are all equivalent:
     
    412407Each of these waits until `s` is positive, then from such a state, decrements `s` and increments `t` without the intervention of other processes.
    413408
     409==== Example
     410
     411{{{
     412$when (s>0) $when (t>0) x=y*t;
     413}}}
     414This blocks until both `x` and `t` are positive then executes the assignment in that state.
     415It is equivalent to
     416{{{
     417$when (s>0 && t>0) x=y*t;
     418}}}
     419
     420
    414421== Functions
    415422