Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: