SyncMemory¶
Orders memory operations without waiting for other images.
Declaration¶
Syntax¶
SyncMemory(expr? stat, expr? errmsg)
Arguments¶
Argument |
Description |
|---|---|
|
a variable receiving the status. |
|
a character variable receiving the error message. |
Return values¶
None.
Description¶
sync memory ends one segment and starts the next on this image alone. It
does not block: it is the building block for user-written synchronisation
built out of atomic operations, where the ordering matters but the waiting is
done by other means.
Examples¶
(SyncMemory
:stat (Var
:v (SymbolRef 1 "stat")
)
:errmsg nil
)
It comes from this complete ASR text document:
(TranslationUnit
:symtab (SymbolTable
:id 0
:symbols {
"main" (Program
:symtab (SymbolTable
:id 1
:symbols {
"n" (Variable
:parent_symtab 1
:name "n"
:dependencies []
:intent :Local
:symbolic_value nil
:value nil
:storage :Default
:type (Integer
:kind 4
)
:type_declaration nil
:abi :Source
:access :Public
:presence :Required
:value_attr false
:target_attr false
:contiguous_attr false
:bindc_name nil
:is_volatile false
:is_protected false
:pass_attr :NotMethod
:self_argument nil
:codims []
)
"stat" (Variable
:parent_symtab 1
:name "stat"
:dependencies []
:intent :Local
:symbolic_value nil
:value nil
:storage :Default
:type (Integer
:kind 4
)
:type_declaration nil
:abi :Source
:access :Public
:presence :Required
:value_attr false
:target_attr false
:contiguous_attr false
:bindc_name nil
:is_volatile false
:is_protected false
:pass_attr :NotMethod
:self_argument nil
:codims []
)
"team" (Variable
:parent_symtab 1
:name "team"
:dependencies []
:intent :Local
:symbolic_value nil
:value nil
:storage :Default
:type (Integer
:kind 4
)
:type_declaration nil
:abi :Source
:access :Public
:presence :Required
:value_attr false
:target_attr false
:contiguous_attr false
:bindc_name nil
:is_volatile false
:is_protected false
:pass_attr :NotMethod
:self_argument nil
:codims []
)
}
)
:name "main"
:dependencies []
:body [
(SyncAll
:stat (Var
:v (SymbolRef 1 "stat")
)
:errmsg nil
)
(SyncImages
:image_set (Var
:v (SymbolRef 1 "n")
)
:stat (Var
:v (SymbolRef 1 "stat")
)
:errmsg nil
)
(SyncMemory
:stat (Var
:v (SymbolRef 1 "stat")
)
:errmsg nil
)
(FormTeam
:team_number (IntegerConstant
:n 1
:type (Integer
:kind 4
)
:intboz_type :Decimal
)
:team (Var
:v (SymbolRef 1 "team")
)
:new_index (Var
:v (SymbolRef 1 "n")
)
:stat nil
:errmsg nil
)
(SyncTeam
:team (Var
:v (SymbolRef 1 "team")
)
:stat (Var
:v (SymbolRef 1 "stat")
)
:errmsg nil
)
(ChangeTeam
:team (Var
:v (SymbolRef 1 "team")
)
:stat nil
:errmsg nil
:body [
(Assignment
:target (Var
:v (SymbolRef 1 "n")
)
:value (IntegerConstant
:n 0
:type (Integer
:kind 4
)
:intboz_type :Decimal
)
:overloaded nil
:realloc_lhs false
:move_allocation false
)
]
:end_stat nil
:end_errmsg nil
)
]
)
}
)
:items []
)