Suppose I have a JSFX that does this:
Code:
local_variable = _global.foo
_global.foo += 1
These kinds of get-and-set operations are red flags from a concurrency perspective, but I don't understand the thread safety aspects of this code in the context of a JSFX, or even if thread safety is relevant.
If all JSFX are executed from a single thread with no preemption possible, as I
believe is the case, then this code is safe. Otherwise, I'm hoping someone can explain to me if it's possible to make it safe (mutexes and the like).
Thanks!