collection Commons
Private · saved on this device

Concurrency and Resource Management

Coordinate waiting, execution, and resource lifetimes with explicit ownership and bounded progress.

These patterns examine how concurrent work progresses and how execution contexts and resources are owned, shared, and released.

Reactor waits for readiness across registered event sources and dispatches short handlers, separating nonblocking I/O, per-connection state, and resource cleanup from the waiting mechanism.

Proactor initiates asynchronous operations and dispatches their completion results, with explicit request identity, buffer lifetime, partial results, cancellation races, and admission bounds.

Active Object turns method invocations into bounded queued requests for an execution owner, with explicit scheduling, deferred results, state isolation, cancellation, and shutdown.

Monitor Object keeps shared state, synchronized methods, and condition waiting behind one monitor lock, with caller-thread execution, predicate rechecking, and explicit closing behavior.

Producer-Consumer separates work creation and execution through a synchronized buffer, with bounded admission, independent consumers, per-job outcomes, completion accounting, and coordinated shutdown.

Thread Pool reuses managed worker threads for independent tasks, separating worker ceilings from admission windows, task futures, owned resources, and pool shutdown.

Resource Pool lends reusable resources for exclusive use, separates scoped borrowing from resource lifetime, and makes return cleanup, exhaustion, and closing behavior explicit.

Scoped Locking binds a successful lock acquisition to scope-owned release, preserving the pairing across normal exits, early returns, and exceptions while leaving invariant recovery and lock ordering explicit.

Scoped Resource Management gives each successful acquisition an owner whose scope releases it, unwinding dependent resources before their dependencies across returns, failures, and partial setup.

Curated selection

In this Collection

9 entries · Author-defined order
  1. Software Engineering

    pattern · commons

    Reactor

    Wait for readiness across registered event sources, then dispatch short handlers that perform nonblocking work and return control to the loop.

  2. Software Engineering

    pattern · commons

    Proactor

    Initiate asynchronous operations with request context, then dispatch their completion results to handlers that decide the next step.

  3. Software Engineering

    pattern · commons

    Active Object

    Turn method invocations into queued requests and execute them through an object's scheduler, keeping its state under one execution owner and returning results separately.

  4. Software Engineering

    pattern · commons

    Monitor Object

    Encapsulate shared state behind synchronized methods, using a monitor lock for exclusive access and condition waiting for state-dependent progress.

  5. Software Engineering

    pattern · commons

    Producer-Consumer

    Separate work creation from execution through a synchronized buffer, with explicit capacity, ownership, and completion rules.

  6. Software Engineering

    pattern · commons

    Thread Pool

    Reuse a managed group of worker threads to execute submitted tasks, separating task lifetime from thread creation and shutdown.

  7. Software Engineering

    pattern · commons

    Resource Pool

    Manage reusable resources behind a borrowing boundary, returning each to circulation only after exclusive use and required cleanup.

  8. Software Engineering

    pattern · commons

    Scoped Locking

    Bind an acquired lock's release to a scope so normal exits, early returns, and exceptions cannot omit the matching unlock.

  9. Software Engineering

    pattern · commons

    Scoped Resource Management

    Give each acquired resource a deterministic owner that releases it when its scope ends, including during failure and partial acquisition.