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

Doesn't this open up the possibility of race conditions?


Hence the use of callbacks for ordering reads and writes as required. Seems like we'd want promises though, for many interleaved reads and writes that are dependent on each other (which is not a great pattern, but might be unavoidable sometimes).


To me it sounds like this all is the wrong place to fix these problems, but then again, these problems are extremely hard for the compiler to optimize.

I personally would opt for explicitly separating the reads from the writes, because

a) the flow of the program gets extremely complicated this way (it's hard to read the order in which instructions are executed)

b) it would avoid race conditions (or worst case make them a lot more obvious.)




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: