Show HN: Starter examples for Project Loom in Java 19
github.com
github.com
Examples illustrate both "virtual threads" (preview status) and structured concurrency (incubator status).
Some of the more interesting examples:
Example #7 launches two tasks with a deadline to complete.
Example #8 implements a custom `StructuredTaskScope` that acts as `invokeSome(n)`. i.e. for M tasks, success is defined when N tasks complete.
Example #10 creates a small hierarchy within a `StructuredTaskScope` and then illustrates that `jcmd` can be used to interrogate the JVM for parent-child relationships.
The examples are highly contrived (often from the JEP docs), and NOT production-grade!