← Back to context

Comment by OutOfHere

5 days ago

In what way does Go have async?

Well, essentially Go doesn't have a separate async keyword because all goroutines run asynchronously under the hood. In the beginning the advised (and default) way of running Go code was GOMAXPROCS=1, essentially ensuring there is no actual parallelism, just asynchronous code. Since then, of course, around Go 1.5, the default switched to number of cores, making goroutines both async and parallel

Aren't goroutines by their nature asynchronous? Am I misunderstanding what you mean by 'async'?

  • Asynchronous is a programming style; it does NOT apply to Go. The goroutines run in parallel. Also, don't use complicated words when simple words will do.

    • In golang, there is no guarantee that goroutines will run in parallel; also, it is quite common to use channels as means of synchronization of results, akin to common async programming patterns.

      1 reply →

    •     Asynchronous is a programming style; it does NOT apply to Go.
      

      Ok, good to know. I guess I jammed threading and async into the same slot in my brain.

          Also, don't use complicated words when simple words will do.
      

      I'm not sure what you mean by this in relation to my above comment.