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

> e.g. you were adding several small positive integers together from a shared data structure in parallel, but due to a misunderstanding in your design this was actually a data race, and some time later somehow your total is now zero

Could you clarify why/how this would happen? Is it because the last process sets it to zero to initialize a variable?

I can’t conceptualize the steps that would end up with this result if all processes are adding. It seems like it would at least equal the result of the final thread’s calculation.



Non aligned data structures being written to. E.g. if you're adding 2 nibbles and writing it to the first part of a byte or writing a byte on a packed struct.




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

Search: