Regent has no global variables. C-style pointers are allowed, but must be used with caution. Mechanisms within the language for achieving mutable state are discussed in later tutorials.
Regent has no concept of a global variable. Technically, Lua variables
are global, but from Regent’s perspective they are fixed at compile
time. For example, the code below is equivalent to attempting the
2 = 3, and fails with a compile error.
Regent allows calls to C functions, and permits the use of C pointers. However, these features must be used carefully in order to comply with the Legion programming model. Consider, for example, that a subtask may execute on a different processor than its parent—so a pointer passed from parent to child might not be valid, and could result in a crash.
Similarly, pointers to C functions may vary between processors and should not be relied upon to be stable.
The restrictions of the Legion programming model are discussed in the C++ tutorial.