←back to thread

305 points kristoff_it | 1 comments | | HN request time: 0.211s | source
Show context
tossandthrow ◴[] No.44609913[source]
The author does not seem to have made any non-trivial projects with asynchronicity.

All the pitfalls of concurrency are there - in particular when executing non-idempotent functions multiple times before previous executions finish, then you need mutexes!

replies(3): >>44610110 #>>44610754 #>>44611759 #
ajross ◴[] No.44610110[source]
> All the pitfalls of concurrency are there [in async APIs]

This is one of those "in practice, theory and practice are different" situations.

There is nothing in the async world that looks like a parallel race condition. Code runs to completion until it deterministically yields, 100% of the time, even if the location of those yields may be difficult to puzzle out.

And so anyone who's ever had to debug and reason about a parallel race condition is basically laughing at that statement. It's just not the same.

replies(2): >>44610305 #>>44614633 #
1. tossandthrow ◴[] No.44614633[source]
Idk, I work in typescript though but I do have race conditions that look exactly like those of concurrent software.

In particular promise.all([f,f,f]) where I want to ensure that I only Run the body of f a single time.