3 ms·
There are different concurrency models. Shared memory multithreading that Go uses is one. Green threads, goroutines, 1:1 threads, M:N threads are all part of th
by zzzcpan 9y ago
There are different concurrency models. Shared memory multithreading that Go uses is one. Green threads, goroutines, 1:1 threads, M:N threads are all part of that model. It has synchronous APIs, concurrent memory access and lots of problems. Callbacks, promises/futures, async/await all deliberately chose a different model, that doesn't have those problems and instead are programmed asynchronously. Their whole purpose is to enable programs that only explicitly give up control. So you can't claim they are the problem if they don't allow implicit blocking, as this is the reason they exist and the way they avoid all of the problems shared memory multithreading has.