Cymetrics Tech Blog

Concurrency Paradigms: Golang V.S. Java

I find that I was just using Golang's syntax to write Java after I reviewed the Golang code I wrote years ago, I was a newbie in Golang then. Especially in writing concurrency programs, the design ideas are totally different between Golang and Java: we are used to designing concurrency with the idea "thread-safe" in Java, but we would use the idea "channel" more in Golang.

Java’s Thread Model and Golang Goroutine

One of the most important features of Golang is its ability to handle high concurrency. And goroutine is the foundation to support high concurrency. This article will briefly explain how Java’s thread model and Golang’s goroutine work in OS. And I believe you will be impressive in the principle behind goroutine. Let’s go!

The Difference Between Java and Golang in Writing Concurrent Code to Access Shared Variable

When writing concurrency code, we often use mechanisms like Lock or Synchronized to protect share resources (sometimes it’s a piece of code). What if we merely want to protect one variable but not a whole code? It’s too expensive to use Lock or Synchronized to protect just one variable.