In this repository the assignments for the SynTouch Loom workshop (by Qun Wang and Jeroen Ninck Blok) can be found. Loom is the name of the OpenJDK project for bringing virtual threads into the JVM. More information can be found here: https://openjdk.org/projects/loom/
Project Loom is implemented using these JEP's:
Virtual threads bring two more new features to the JVM:
- Structured concurrency
- Scoped values
This project can either be run locally or using a devcontainer.
- Install Visual Studio Code with Remote Development Extension Pack
- Install Docker
- Open the repository in Visual Studio Code and start the devcontainer
There are three assignments which show the capabilities (and API's) of virtual threads, structured concurrency and scoped values.
- loom-http-client: Simple HTTP client used with virtual threads
- loom-spring-boot: Implement virtual threads and structured concurrency in a Spring Boot 3.0 application
- thread-pinning: Thread pinning using synchronized code
- scoped-values: Implement scoped values (next the
ThreadLocal
) in a regular Java app - loom-quarkus: Use the Quarkus virtual thread API
- To start a Spring Boot application using Maven:
mvn spring-boot:run
- To start a Java application using Maven:
mvn exec:java
- To start a Quarkus application using Maven:
mvn quarkus:dev