View Single Post
Old 06-10-2019, 04:34 PM   #1
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 741
Default JSFX, _global, and concurrency

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!
tack is offline   Reply With Quote