3 ms·
In what way does Go have async?
by OutOfHere 1y ago
In what way does Go have async?
- all2 1y agoAren't goroutines by their nature asynchronous? Am I misunderstanding what you mean by 'async'?
- OutOfHere 1y agoAsynchronous 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.
- all2 1y agoAsynchronous 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.
- aforwardslash 1y agoIn 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.
- OutOfHere 1y ago> In golang, there is no guarantee that goroutines will run in parallel; That's not specific to Go lang. Most of the constraints you're thinking of apply to all parallel programming languages. It goes with the territory. All parallel programming languages impose certain flavors of their management of parallelism.
- sa46 1y agoGo is certainly capable of async programming. https://en.wikipedia.org/wiki/Asynchrony_(computer_programming) https://en.wikipedia.org/wiki/Asynchrony_(computer_programmi... > The goroutines run in parallel. Also, don't use complicated words when simple words will do. That’s not called for, especially since you’re wrong.
- nasretdinov 1y agoWell, 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