RickLynn Lee / Runtime Lab

Java Runtime Lab / 02

Cheap threads.
Finite downstream.

12 real virtual-thread tasks, 3 declared downstream slots. Compare admission policies, then follow a cancelled permit holder.

Loading recorded evidence…

Inspect the downstream boundary

Task and resource transitions
Actual JFR counts and capture contract

What the controls establish

Unbounded is a counterexample: virtual threads alone do not enforce the declared resource capacity. Queue and reject use real Semaphore permits. The queued count is the number registered as waiting, not a sample of the JVM’s internal queue. The waiting policy has no independent queue-size limit; this burst is finite.

A queued cancellation must never enter downstream. A cooperative holder exits and returns its permit. The ignore-interrupt control remains active even after Future cancellation; its gate is then released and all permits must return. “Cancelled” counts interrupted task lifecycles, including that finite control.

JEP 491 removed synchronized-related pinning in JDK 24. The pinned-event count below is only what this workload recorded. No event is invented and no absence is treated as proof. Structured concurrency remains optional preview reading; this Lab does not enable preview.

Exact protocol, oracle and limitations → · Six executable learning units →