An Actor Model in Go
summary
An actor style is implemented as a struct plus a goroutine that pulls work from a chan mailbox and executes closures so functions-as-messages are sent, queued and run single-threaded. Used inside Weave Net for a connection maker and an IP address manager, it runs in production for two years and simplifies code by avoiding fine-grained mutexes. Channels are sized pragmatically (tests at size 1, prod usually 16-sized channel) and the model is simpler but no locks but not deadlock-proof—full queues can still deadlock across goroutines or machines.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:37Actor Model
- 2:09Actors for Concurrent Systems
- 2:56Bryans Background
- 4:10Connection Maker
- 5:48Properties
- 7:16Actor
- 8:23Concurrency
- 9:08Go Routine
- 15:51Example
- 20:50Un unbounded channels
- 25:31Cons
- 30:18Conclusion
related talks
54mIntroduction to the Actor Model
31mActor, Thread and me
39mMobiconf 2018: Bartosz Polaczyk, Grand Parade
44m10 Lessons From Implementing The Actor Model
45mSo you want to be an actor? Lessons from implementing the actor model
26mAn Exceptional Actor System (Functional Pearl)
54mScala concurrency patterns with Actors
27mWorkflow library in Go for API development
