← All Learning Paths

Concurrency Engineer

Write correct concurrent code: data races and happens-before, structured concurrency, worker pools, work stealing, and race detection.

technicaladvanced7 nodes11.92h total

Path overview

编写正确的并发代码:数据竞争与 happens-before、结构化并发、工作池、工作窃取与竞争检测。

Write correct concurrent code: data races and happens-before, structured concurrency, worker pools, work stealing, and race detection.

  1. Execute "Worker Pool Bounded Goroutines", change one constant, and describe how the output diverges from "Process a job channel with a fixed pool of workers, draining remaining jobs on shutdown and".

    Completion criteria: Change one constant in "Worker Pool Bounded Goroutines", rerun, and attach both stdout captures plus a one-line diff explaining what moved.

    Next step: Tokio Semaphore Bounded Concurrency

    ⏱ 0.75h

  2. Run the concurrency engineer snippet "Tokio Semaphore Bounded Concurrency", capture stdout, and show which line demonstrates the documented behavior: "Cap concurrent tasks with a tokio semaphore through acquire_owned, applying per-key fairness".

    Prerequisites: Worker Pool Bounded Goroutines

    Completion criteria: Paste the command, the exit code, and the output line matching "Cap concurrent tasks with a tokio semaphore through acquire_owned, applying per-key fairness"; then show a second run with a changed parameter.

    Next step: Thread Pool with ExecutorService

    ⏱ 0.75h

  3. Adapt "Thread Pool with ExecutorService" to a second input and compare the new output with the behavior described in "Creates a fixed thread pool to execute multiple tasks concurrently, demonstrating proper".

    Prerequisites: Tokio Semaphore Bounded Concurrency

    Completion criteria: Save two runs of "Thread Pool with ExecutorService" side by side — the original input and one changed value — and annotate the line where the output diverges.

    Next step: Thread Pool Map With Timeout

    ⏱ 0.75h

  4. Execute "Thread Pool Map With Timeout", change one constant, and describe how the output diverges from "Map a function over items with a bounded thread pool, preserve input order, and cancel".

    Prerequisites: Thread Pool with ExecutorService

    Completion criteria: Change one constant in "Thread Pool Map With Timeout", rerun, and attach both stdout captures plus a one-line diff explaining what moved.

    Next step: Write Tests That Actually Catch Concurrency Races

    ⏱ 0.75h

  5. Apply "Write Tests That Actually Catch Concurrency Races" to a concurrency engineer task, checking that "Two hundred concurrent increments either hold the invariant or fail reproducibly enough to" appears after the "Expose a suspected race condition in shared-state code with a test that reliably reproduces" step.

    Completion criteria: Deliver a transcript of "Write Tests That Actually Catch Concurrency Races" with each step's command and observed state, ending at "Expose a suspected race condition in shared-state code with a test that reliably reproduces".

    Next step: Schedule Tasks Under a Concurrency Limit

    ⏱ 0.5h

  6. Build "Schedule Tasks Under a Concurrency Limit" for concurrency engineer code and verify [{id:t1,startMs:0,endMs:100},{id:t2,startMs:0,endMs:50},{id:t3,startMs against both samples.

    Prerequisites: Write Tests That Actually Catch Concurrency Races

    Completion criteria: Attach the solution file for "Concurrency Engineer", two passing sample runs, and one failing run whose error matches the contract.

    Next step: Capstone: Concurrency Engineer

    ⏱ 0.42h

  7. Deliver the "Build an In-Process Job Queue with Workers and Retries" blueprint with "Enqueue jobs by name with a JSON payload and get a stable id back." working and "Execute jobs through a bounded pool with configurable concurrency." recorded as evidence.

    Prerequisites: Write Tests That Actually Catch Concurrency Races, Schedule Tasks Under a Concurrency Limit

    Completion criteria: Run the project's test command for "Build an In-Process Job Queue with Workers and Retries", paste the passing output, and attach the acceptance note for "Enqueue jobs by name with a JSON payload and get a stable id back." with the test name.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h