← Back to context

Comment by gf000

2 days ago

You wrote:

> The job wouldn’t have been done. They would have needed threads. And mutexes. And spin locks. And atomics. And semaphores. And message queues. And - in my opinion - the result would have been a much worse language.

My point is that you do need mutexes, spin locks, etc with async as well, given that you have a multi threaded platform. So no, we have basically 2x2 stuff we are talking about with very different properties (async/sync x single/multi threaded).

> My point is that you do need mutexes, spin locks, etc with async as well, given that you have a multi threaded platform.

No, Javascript isn't a shared-memory multi threaded platform. It would only need mutexes and so on if we added threads to javascript, as the comment I was replying to suggested should have happened:

> At any step in that sequence, the language could have introduced green threads and the job would have been done

  • That's why I brought up C# as an example of a language with multi threaded async. But Kotlin is another example.