4 ms·
1) Go code has the same locks that java synchronized code is, they're also used a lot 2) Go encourages more threads than java does because of the M:N threading
by candiodari 8y ago
1) Go code has the same locks that java synchronized code is, they're also used a lot
2) Go encourages more threads than java does because of the M:N threading model
3) Go's concurrency primitives (channels and select) is actually more complex than the java equivalents
4) Go's concurrency gives the programmer less control (e.g. how do you say, I want max 40% cpu time spent on X ?)
In my opinion the big thing that protects Go is twofold:
a) Go is still not very common among bad programmers. Java is.
b) it is much harder to write large Go programs than it is to write large Java programs. That doesn't make those big Java programs bad. Some problems are big and require big solutions, say, CAD, or a company platform. Go is frankly unfit for those problems. Especially because Java has tooling that makes analyzing and working on large programs feasible and Go has at best the very beginnings of such tooling.