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

No compiler can reason about whether some high-level piece of code is semantically order-of-execution dependent or not; not every non-deterministic piece of code is a race-condition.


You: "not every non-deterministic piece of code is a race-condition"

Wikipedia: "A race condition ... is ... where the output is dependent on the sequence or timing..."

Boom! Headshot!


    Boom! Headshot!
That adds nothing to the discussion and makes it feel more adversarial. It reduces the quality of discussion for no gain. Please don't do that again.


The wikipedia article means the sequence or timing of the execution of the instructions in relation to each other.

Non-deterministic code does not only encompass code of which the results vary with the timing of instructions relative to each other, but also code of which the results vary with the timing of instructions relative to the state of the universe or anything in it.


Being nondeterministic doesn't necessarily meant the output differs. (E.g. a program that increments a global counter (with a lock) once from each of ten threads and prints the count after all threads are finished; the increments happen in a nondeterministic order but the output is always 10.)




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

Search: