Changes between Version 31 and Version 32 of Language


Ignore:
Timestamp:
05/20/23 10:37:35 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language

    v31 v32  
    664664Note that a thread waiting to return from a `$yield` has no special priority, even if that `$yield` is inside at local region.
    665665Only `$local_start` grants a thread a special priority.
    666 This is illustrated in the following example.
    667 
    668 ==== Example
    669 
    670 
    671666
    672667=== Heap memory allocation: `$malloc` and `$free`
     
    714709=== Yielding atomicity: `$yield`
    715710
     711{{{
     712$system void $yield();
     713}}}
     714
     715The yield function is used inside an atomic or local region to release the atomic lock so that other processes may execute.
     716The yielding process retains its current atomic lock multiplicity, so that if and when it regains the atomic lock, it proceeds executing
     717with the same multiplicity it had before the yield.
     718In order for the yielding process to return from the call to `$yield`, and thereby regain the atomic lock, the first statement following
     719`$yield` must be enabled.
     720This statement behaves as a guard for regaining the atomic lock, just as the first statement of an atomic block, or the first statement
     721following `$local_start()`, acts as a guard for entering an atomic or local region.
     722The yielding process competes with other processes to obtain the lock; it does not have any special priority.
     723In particular, if the lock is available and there is a process at a `$local_start()` call (and the first statement following the call is enabled), one such a process is guaranteed to obtain the lock.
     724
    716725== Macros
    717726