Expressive actor models combine aspects of functional programming into the pure actor model enriched with futures. Such functional features include first-class closures which can be passed between actors and chained on futures. Combined with mutable objects, this opens the door to race conditions. In some situations, closures may not be evaluated by the actor that created them yet may access fields or objects owned by that actor. In other situations, closures may be safely fired off to run as a separate task.
This paper discusses the problem of who can safely evaluate a closure and how to avoid race conditions, and presents the current solution to the problem adopted in the Encore programming language. The solution appeals to Encore’s capability type system, which is used to influence whether a closure is attached and must be evaluated by the creating actor, or whether it can be detached and evaluated independently of its creator.
Encore’s solution is not the final answer. We conclude the paper with a number of open problems related to dealing with closures in the actor model.
Mon 5 NovDisplayed time zone: Guadalajara, Mexico City, Monterrey change
13:30 - 15:00
|Chocola: Integrating Futures, Actors, and Transactions|
Janwillem Swalens Vrije Universiteit Brussel, Joeri De Koster Vrije Universiteit Brussel, Belgium, Wolfgang De Meuter Vrije Universiteit BrusselPre-print
|Concurrent Garbage Collection in the Actor Model|
|Attached and Detached Closures in Actors|