DIY Actors using Project Loom
summary
Argues that a minimal actor API is implementable with Java executors plus Loom: uses Executor.newSingleThreadExecutor for per-actor sequential scheduling and plugs a virtual thread ThreadFactory so hundreds of actors run on few platform threads. Implements ActorRef with send and ask (promise-backed), injects a Context for stop/timers/self, shows a buncher state machine and child-spawn/stop semantics, demonstrates no lost updates under 10,000 concurrent sends, and offers a simpler method-based strand alternative that passes the tests.
AI-written summary · about
chapters (14)
- 0:00DIY Actors with Loom
- 2:14Actor basics and Loom's role
- 6:28Simple bank account actor
- 10:05Actors to virtual threads
- 13:20Virtual threads solve overhead
- 15:48Actors with context interface
- 18:56Ask pattern implementation
- 21:06Safe future callbacks
- 23:17Adding timers to actors
- 25:02Self-reference in actors
- 27:52Child actors and hierarchies
- 33:13State machines with actors
- 36:06Strand pattern intro
- 39:38Conclusions and use cases
related talks
35mUntangled: Sneak peek at Project Loom
01h 01mProject Loom: Revolution in Concurrency or Obscure Implementation Detail?
02h 46mWill Loom Protect Us from Temporal Robbery?
01h 13mProject loom: Modern scalable concurrency for the Java platform
50mProject Loom: Helping Write Concurrent Applications on the Java Platform
42mProject Loom Update
44mLoom: Revolution or Implementation Detail?
01h 00mProject Loom? Better Futures? What’s next for JVM concurrent programming
