AyazKhuraishi / concurrency-in-java-demos

Demonstrates the basic features of Concurrency in Java and offers a few simple assignments.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Concurrency options in enterprise software

Java/Jakarta EE

Prior to Java EE 7, there were no specific APIs that allowed enterprise developers to use concurrency utilities in a safely standard manner. The Java EE web and EJB containers instantiate objects using container-managed thread pools. Therefore, using Java SE concurrent APIs to instantiate Thread objects was strongly discouraged. If a developer creates a new (non-managed) Thread object, the container could not guarantee that other Java EE platform services (for example, transactions and security) would be part of this Thread. (more on this)

Starting from Java EE 7, a ManagedExecutorService is available.

Currently there is no support for a managed ForkJoinPool in Jakarta EE. It is strongly advised not to mix a Java SE ForkJoinPool with Jakarta EE technologies, due to the fact that Jakarta EE can only manage threads that it created itself.

Spring

  • Comes with an own implementation of Executor, like TaskExecutor. (source)
  • Asynchronous methods (higher abstraction level). (source)
  • Transactional. (source)
  • ForkJoinPoolFactoryBean. (source)

Project Loom

A good introduction of Project Loom.

About

Demonstrates the basic features of Concurrency in Java and offers a few simple assignments.

License:Apache License 2.0


Languages

Language:Java 100.0%