Java Multi-threading Evolution and Topics

One of our reader, Anant, asked this extremely good question to elaborate / list down all related topics that we should know about multi-threading including changes made in java 8.( Beginner level to Advance level). All he wanted to know was evolution of Multi-threading Framework in Java from Simple Runnable interface to latest feature in Java 8. Let us solve his query.

I spent good amount of time in collecting all below information. So please feel free to suggest edit/update in below information if you think otherwise on any point.

JDK release-wise multi-threading concepts

As per JDK 1.x release, there were only few classes present in this initial release. To be very specific, there classes/interfaces were:

  • java.lang.Thread
  • java.lang.ThreadGroup
  • java.lang.Runnable
  • java.lang.Process
  • java.lang.ThreadDeath
  • and some exception classes

e.g.

  1. java.lang.IllegalMonitorStateException
  2. java.lang.IllegalStateException
  3. java.lang.IllegalThreadStateException.

It also had few synchronized collections e.g. java.util.Hashtable.

JDK 1.2 and JDK 1.3 had no noticeable changes related to multi-threading. (Correct me if I have missed anything).

JDK 1.4, there were few JVM level changes to suspend/resume multiple threads with single call. But no major API changes were present.

JDK 1.5 was first big release after JDK 1.x; and it had included multiple concurrency utilities. Executor, semaphore, mutex, barrier, latches, concurrent collections and blocking queues; all were included in this release itself. The biggest change in java multi-threading applications cloud happened in this release.

Read full set of changes in this link: http://docs.oracle.com/javase/1.5.0/docs/guide/concurrency/overview.html

JDK 1.6 was more of platform fixes than API upgrades. So new change was present in JDK 1.6.

JDK 1.7 added support for ForkJoinPool which implemented work-stealing technique to maximize the throughput. Also Phaser class was added.

JDK 1.8 is largely known for Lambda changes, but it also had few concurrency changes as well. Two new interfaces and four new classes were added in java.util.concurrent package e.g. CompletableFuture and CompletionException.

The Collections Framework has undergone a major revision in Java 8 to add aggregate operations based on the newly added streams facility and lambda expressions; resulting in large number of methods added in almost all Collection classes, and thus in concurrent collections as well.

Read full set of changes in this link: http://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/changes8.html

References:

I hope that above listings will help you understanding the multi-threading features JDK version wise.

Happy Learning !!

Was this post helpful?

Join 7000+ Awesome Developers

Get the latest updates from industry, awesome resources, blog updates and much more.

* We do not spam !!

8 thoughts on “Java Multi-threading Evolution and Topics”

  1. Great work!
    very helpful in preparing for interviews.

    Will appreciate if you could add some advanced interview programing questions as well.

    Reply
  2. I love your blog, recently started learning java in detail for interviews as experienced programmer. And your blog come very handy.

    Reply
  3. Its a very useful article to see in a nutshell what happened over the lifetime with java concurrency and multithreading programming. A more elablorated version maybe with more hyperlinks to read details about them or example would make it the world best arcticle on multithreading. Just a thought. Thanks for this article though.

    Reply

Leave a Comment

HowToDoInJava

A blog about Java and related technologies, the best practices, algorithms, and interview questions.