Changes between Version 40 and Version 41 of IR2


Ignore:
Timestamp:
04/28/21 17:13:01 (5 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR2

    v40 v41  
    142142  | (lvalue '=')? '$spawn' expr '(' arg-list? ')' ';'  /* process creation */
    143143  | 'return' expr? ';'  /* return from function call */
    144   | '$parspawn' expr ',' expr ',' expr ';'  /* parallel spawn */
    145144  | (lvalue '=')? '$alloc' '(' expr ',' expr ',' type-name ')' ';'  /* heap allocation */
    146145arg-list: expr (',' expr)* ;  /* actual argument list */
     
    151150
    152151* For function calls and spawns, the first expression shall have type pointer-to-function-....  The function pointed to will be the one called or spawned.  That function must be a system or defined function (not an abstract function).
    153 * The 3 expressions in a `$parspawn` are (1) pointer to the first element of the process array, an expression of type `$proc*`, (2) an expression of type `$domain`, and (3) an expression of type pointer-to-function-....  The function must have the type that consumes n `$int`s, where n is the dimension of the domain, and returns `void`.   The function is spawned once for each element of the domain.  References to the new processes are stored in the process array. 
    154152* The first expression following `$alloc` has type `$heap*`.  It is a pointer to the heap that will be modified by allocating the new memory.  The second expression has type `$int` and is the number of elements being allocated.    This is followed by the element type.    The function returns a pointer to the first element of an array, similar to C's malloc.    It is deallocated using function`$free`.
    155153
     
    182180=== `seq.cvh` ===
    183181
     182=== `set.cvh` ===
     183
    184184=== `map.cvh` ===
     185
     186=== `rel.cvh` ===
    185187
    186188=== `concurrency.cvh` ===
    187189
     190{{{
     191$parspawn($proc * proc_array, $domain d, void (*f)($int, ...));  /* parallel spawn */
    188192
     193}}}
     194
     195* In`$parspawn` `*f` must have the function type that consumes n `$int`s, where n is the dimension of the domain.   The function is spawned once for each element of the domain.  References to the new processes are stored in the process array.   The call to `$parspawn` returns immediately.