Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Multi Thread vs Go Multi Thread

 
Ninad Kulkarni
Ranch Hand
Posts: 802
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will multi threading in GO is better than Java?
 
Mark Summerfield
author
Ranch Hand
Posts: 37
Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ninad,

Yes, concurrency in Go is better than in Java or C++.

This is because Go uses extremely lightweight "threads" called goroutines. On many desktop computers even creating 10s or 100s of threads causes problems, using Go to create 100s, 1000s, or 10000s of goroutines is no problem at all. Also Go's approach to concurrency is much higher level than Java or C++'s approaches: this makes concurrency in Go easier to program and reason about.
 
Ninad Kulkarni
Ranch Hand
Posts: 802
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark,
GO seems to be interesting.
 
Mark Summerfield
author
Ranch Hand
Posts: 37
Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ninad,

Yes, I think that Go is the most interesting new language I've seen since Java appeared in the mid 1990s!
 
Michael Swierczek
Ranch Hand
Posts: 125
1
Clojure Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Summerfield,

I've read a lot of good things about go's goroutines. However, Java now has something similar (which may have been inspired by goroutines, I don't know) from the Akka library: http://akka.io/

For certain classes of multi-threaded programming in Java, thanks to Akka you no longer need to manage threads and synchronization yourself.

 
Mark Summerfield
author
Ranch Hand
Posts: 37
Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael,

As I mentioned in another post there's no doubt that C++ and Java will get CSP libraries---but this isn't the same as having the facility built-in.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic