Reliability Labs

Java Concurrency Budget Lab

Model fixed pools, virtual threads, resource guards, deadlines, and cooperative cancellation with a deterministic browser-only timeline.

Local workbench
Input stays in this browserRun with Ctrl/⌘ + Enter

Deterministic browser-only state machine

Java Concurrency Budget Lab

Compare task admission, resource demand, deadlines, and cooperative cancellation without creating threads or measuring performance.

Six teaching scenarios

Load a fixed concurrency boundary

Choose inputs or load a preset. Nothing leaves this browser.

Deterministic result

Timeline and capacity summary

TickTaskPhaseDetail

Boundary and production questions

    How to use it

    Use six fixed scenarios or choose one input at a time. Every task arrives at tick 0, events use a stable task-ID order, and deadline interruption happens before work advances at its tick. The same input produces byte-identical results.

    Fixed pools apply worker-plus-queue admission. Virtual-thread-per-task execution accepts and starts every task, while a separate guard controls demand on the modeled finite resource. With no guard, excess demand becomes explicit contention and capacity-breach evidence; the lab does not invent a downstream failure.

    Read Java Concurrency Budget Lab: Queues, Virtual Threads, and Cancellation for a walkthrough of all six scenarios. Continue through Java Virtual Threads for Backend Services, Java Interruption, Cancellation, and Deadlines, and Production Java Concurrency Troubleshooting.

    This lab is not a performance test, capacity plan, JVM benchmark, thread-pool calculator, or source of deployable Spring configuration. Nothing leaves this browser.

    Related tools

    Keep the workflow moving

    These local-first tools often pair well with Java Concurrency Budget Lab.

    FAQ

    Java Concurrency Budget Lab questions

    Does the lab create Java threads or benchmark my browser?

    No. It is a deterministic discrete-event teaching model that creates no threads, runs no benchmark, calls no API, and uploads no input.

    Can the result size a production thread pool or downstream limit?

    No. Tick durations and teaching ranges are synthetic. Production capacity requires measured workload, JVM, connection, dependency, and user-outcome evidence.

    Why are worker and queue fields disabled for virtual threads?

    The virtual-thread-per-task model starts every task and does not apply fixed-executor admission. CPU, connections, and downstream resources remain separately limited.

    Does a canceled task prove an external side effect stopped?

    No. The cooperative branch models local observation of interruption. Databases, HTTP calls, payments, and email retain their own deadline, idempotency, and reconciliation contracts.