(no title)
omgbear | 1 year ago
But, eventually I realized the difference in pre-emption between languages -- Go can (now) preempt your code in many places, so locks and thread-safety are very important.
The javascript runtime only preempts at certain places, `await` being one. This means I can know no other code can be running without explicit locks around all critical sections.
Finally understanding the trade-offs, I no longer am as frustrated when recoloring a bunch of functions. Instead, I can appreciate the areas where I'm not required to lock certain operations that I would in other languages.
sakex|1 year ago
[1]https://en.wikipedia.org/wiki/Cooperative_multitasking#:~:te....
ndndjdueej|1 year ago
orlp|1 year ago