3 ms·
That doesn't explain it. The runtime execution could still be like this: thread #1: local a = x[i] a = a + 1 context_switch() thread #2: l
by tomp 14y ago
That doesn't explain it. The runtime execution could still be like this:
thread #1:
local a = x[i]
a = a + 1
context_switch()
thread #2:
local b = x[i]
b = b + 1
x[i] = b
context_switch()
thread #1:
x[i] = a
resulting in a wrong (or merely unexpected) result.