Java multi-threaded evolutionary history [translation]

One of our readers, Anant recently asked a very good question. He wants us to elaborate / list of all the topics that we should know about multi-threading as well as changes in java 8 in. (From beginner to advanced). He wanted to know java multithreading framework from simple Runnableevolutionary process interface to the latest features of java 8. Let us resolve his request.

I spent a lot of time to gather information. So if you have other views, please feel free to ask.

JDK release multi-threading concepts

For each 1.x JDK version, the original version of the few multi-threading related classes. Specifically, classes / interfaces as follows:

  • java.lang.Thread
  • java.lang.ThreadGroup
  • java.lang.Runnable
  • java.lang.Process
  • java.lang.ThreadDeath

Some unusual categories such as:

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

As well as a collection of synchronization. such as:java.util.Hashtable

JDK 1.2 and JDK 1.3 did not change significantly with respect to multi-thread. (If I missed anything please correct me)

JDK 1.4 has occurred in some of the JVM level changes. It can use a single call to suspend / resume multithreading. But it did not produce major changes in the API.

JDK 1.5 is JDK 1.x first major release after; it contains multiple concurrent toolkit. Executor, semaphore, mutex, barrier, latches, concurrent collectionsAnd blocking queues; the biggest changes in a lot of java-threaded applications from the version.

阅读完整变化: http://docs.oracle.com/javase/1.5.0/docs/guide/concurrency/overview.html

JDK 1.6 is more of a number of platforms rather than repair API upgrade.

JDK 1.7 introduces support for ForkJoinPoolsupport. It implements a work-stealing technique to maximize throughput. PhaserClass was also added in.

JDK 1.8 because Lambda is widely known, but it also has something about concurrent changes. Two new interfaces and four new classes are added to the java.util.concurrent package. For example: CompletableFuture, CompletionException.

In order to increase based streams facility and lambda expressions polymerization operation of these new features, set in a frame undergoes a major modification java8; this results in a large number of methods are added to almost all of the collection classes, of course, also includes a set of complicated.

阅读完整变化: http://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/changes8.html

Relevant guidelines

I hope things listed above can help you understand the characteristics of multi-threaded version of the JDK.

Guess you like

Origin juejin.im/post/5d01fdbbf265da1ba647e6ce