3 ms·
Well, my point is that go has the same concept of sync and async as Java. All Java code can be preempted at any point, thats how threads work. Go is more effici
by Skinney 6y ago
Well, my point is that go has the same concept of sync and async as Java. All Java code can be preempted at any point, thats how threads work. Go is more efficient at scale as it uses a more light weight unit of concurrency under the hood, but from a developers standpoint the code functions in the same way.
So if you think Go is pure-async, then Java is pure-async, as it has access to the same primitives as Go for dealing with concurrency. It’s just that Java, at the moment, spawns a full thread wheres Go does something more light weight under the hood.
Unless, of course, you define async as doing something with coroutines/fibers. But I’d argue that is an implementation detail.
In any case. We are essentially agreeing. Go avoids the two-color problem by having single colored functions. Wheras Rust, JS, C# have two-colored functions.
- aliceryhl 6y agoWell I define async as being able to run many things without spawning a separate thread for each thing, by somehow swapping the current task every so often. Call it an implementation detail if you want, but in my eyes, it is what makes the difference between all-async and all-sync.