~/talk

Thread internals and related design patterns

Talkat JCON-ONLINE 2021 · 2021-10-05..10-08· [concurrency]
links:none on file
slides:none on file

Explains two concrete patterns and two anti‑patterns with Java code: a keyed executor that hashes keys to single‑threaded ExecutorServices to enforce causal ordering (implemented and published on GitHub), and request collapsing where the cache stores a CompletionStage/CompletableFuture to collapse duplicate DB queries — this reduces duplicate IO and releases multiple waiters when one DB call completes. Warns that naive futures cause an execution rabbit hole and recommends CompletableFuture chaining and thenApplyAsync; notes risks (thread thrashing, complex exception handling) and tradeoffs in latency vs throughput.

AI-written summary · about

  1. 0:00Introduction
  2. 6:51causal ordering
  3. 13:53keyed executor
  4. 18:10request collapsing
  5. 27:08antipattern
  6. 28:15general idea
  7. 35:26callbacks
  8. 43:44future everywhere
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.