Changes between Version 22 and Version 23 of Language


Ignore:
Timestamp:
05/19/23 17:42:22 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language

    v22 v23  
    555555If `p` is undefined or `$proc_null`, returns 0.
    556556
    557 === Modifying the dependence relation: `$local_start` and `$local_end`
    558 
     557=== Specifying local regions: `$local_start` and `$local_end`
     558
     559CIVL-C provides primitives to constrain the interleaving semantics of a program.
     560The program state has a single atomic lock, initially free.
     561At any state, if there is a thread ''t'' that owns the atomic lock, only ''t'' is enabled.
     562When the atomic lock is free, if there is some thread at a `$local_start` statement, and the first statement following `$local_start` is enabled,
     563then among such threads, the thread with lowest ID is the only enabled thread; that thread executes `$local_start` and obtains the lock.
     564When ''t'' invokes `$local_end`, ''t'' relinquishes the atomic lock.
     565Intuitively, this specifies a block of code to be executed atomically by one thread, and also declares that the block should be treated as a local statement,
     566in the sense that it is not necessary to explore all interleavings from the state where the local is enabled.
     567
     568Local blocks can also be broken up at specified points using function `$yield`.
     569If ''t'' owns the atomic lock and calls `$yield`, then ''t'' relinquishes the lock and does not immediately return from the call.
     570When the atomic lock is free, there is no thread at a `$local_start`, a thread ''t'' is in a `$yield`, and the first statement following the `$yield` is enabled,
     571then ''t'' may return from the `$yield` call and re-obtain the atomic lock.
    559572
    560573=== Heap memory allocation: `$malloc` and `$free`