Skip to content

Day 084 — Month 3 Review + Tag v0.3.0

Month 3 · Week 4 · ⬅ Day 083 · Day 085 ➡ · Journal index

📋 Full structured reviews: week-4-review.md · month-03-review.md

🎯 Learning Objective

Close out Month 3 (Concurrency & Parallelism): recall the whole toolkit closed-book, confirm the crawler capstone is -race-clean and profiled, write the month review, and tag the release v0.3.0.

📚 Topics

  • Recap of the month: goroutines/channels/select → the sync toolbox & atomics → concurrency patterns → the crawler project (pool, dedup, context, rate limiting, tests, profiling).

📝 Notes

  • Re-ran every Month 3 example with go run and the full exercise suite with go test -race ./exercises/month-03/... — all green, no races.
  • gofmt -l . clean; go vet ./... clean (context first-param, no lost cancel()/Stop(), no copied locks, no leaked goroutines).
  • Reimplemented the crawler's owner loop (dedup + outstanding-work counter) and the token bucket from memory — both correct first try.
  • Wrote the week-4 review and the month-03 review; tagged v0.3.0.

🧠 Closed-Book Recall (Month 3)

  1. Q: The channel axioms — send/receive/close on nil and closed channels?
    ASend/recv on nil blocks forever; send on closed panics; recv on closed yields zero value + ok=false; close of nil/closed panics.
  2. Q: Single-owner dedup vs. mutex Set — when each?
    ASingle owner (over channels) when one goroutine can hold the map; mutex Set when many goroutines need direct concurrent access — make check-and-insert one critical section.
  3. Q: Does cancelling a context stop goroutines?
    ANo; it closes Done(). Each goroutine must select on it and return. Always defer cancel().
  4. Q: Bounded parallelism vs. rate limiting?
    AHow many at once (worker pool/semaphore) vs. how often over time (token bucket / time.Ticker). Orthogonal.
  5. Q: Does a green -race run prove no races?
    ANo — only races on executed interleavings are caught. Stress the racy paths and assert invariants.
  6. Q: Which profile for lock contention vs. leaks?
    AMutex/block profile for contention (enable sampling); goroutine profile / climbing NumGoroutine for leaks.

🪶 Feynman Reflection

Month 3 went from the atoms (a go statement, a channel, a select) to the molecules (mutexes, WaitGroup, atomics), to structures (pools, fan-in/out, pipelines, semaphores, context, rate limiting), and finally to a working machine — a bounded, cancellable, rate-limited, race-tested, profiled crawler. I can now design and defend a concurrent system, not just write a goroutine.

🕳️ Knowledge Gaps Carried Forward

  • Real HTML parsing and per-host politeness (third-party / production concerns).
  • runtime/trace, pprof labels, and goroutine-leak detection in CI.

✅ Summary

Month 3 complete: concurrency toolkit consolidated and applied in a crawler capstone that is -race-clean, gracefully shutdown, rate-limited, and profiled. Released v0.3.0. Confidence on concurrency now ⅘.

⏭️ Next Steps

  • Month 4: building networked services (HTTP servers, JSON APIs, middleware) on top of this concurrency foundation.

Time spent Difficulty Confidence
75 min 🟦⬜⬜⬜⬜ 🟦🟦🟦🟦⬜

Suggested commit: docs(journal): month 3 review (day 084) then git tag -a v0.3.0 -m "Month 3 complete: concurrency & parallelism"