Hi! I’m currently going about implementing Parallel Luau into my collision detection code.
Currently, I am having workers send their results back to a parent worker. They do this by appending their results to an array and incrementing a counter. Once this counter is equivalent to the number of workers assigned, it is sent to an array.
My question is, is it possible for the work increment to finish before the array append?
Some example code would look like this:
local shared1 = SharedTable.new({Array = {}})
local shared2 = SharedTable.new({Test = 0})
SharedTable.update(shared1, "Ya", function(cVal)
cVal["a"] = "b"
end)
SharedTable.increment(shared2, "Test", 1)
Is it ever possible for SharedTable.increment(shared2, "Test", 1)
to run before SharedTable.update(shared1, "Ya", ...)
? I cannot test this by yielding within the first statement, as that thread is not yield-able. Thanks!