Read Antoine van der Lee’s blog post Actors in Swift: how to use and prevent data races and by link from there read WiKi article Actor model.