You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which means that the common counter is actually not being incremented more than ¼ of the time!
I'm guessing this is because of: tab.ccommon = tab.ccommon + 1.
By the time the read of the field tab.ccommon has completed, the other thread might have incremented it already, and that new value is lost.
This looks unavoidable to me, but I'd be thrilled to know if there is any possible approach to mitigate this problem.
The text was updated successfully, but these errors were encountered:
I'm running into some concurrency issues using Effil.
Such issues are well described by a simple example.
In the example, two parallel threads act on the same effil table, each incrementing two counters:
c1
and the common counterccommon
c2
and the common counterccommon
Each thread runs for 1000 loops, so at the end
c1=1000
,c2=1000
and, in theory,ccommon=2000
.However, in my testing,
ccommon
is often much less! A typical output is:Which means that the common counter is actually not being incremented more than ¼ of the time!
I'm guessing this is because of:
tab.ccommon = tab.ccommon + 1
.By the time the read of the field
tab.ccommon
has completed, the other thread might have incremented it already, and that new value is lost.This looks unavoidable to me, but I'd be thrilled to know if there is any possible approach to mitigate this problem.
The text was updated successfully, but these errors were encountered: