You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Concurrency] Implement basic actor isolation rules.
Implement a basic set of isolation rules for actors, which includes:
* Asynchronous actor methods can be invoked on any actor instance.
* All mutable instance properties and synchronous instance methods are
only accessible via "self" or "super" within the context of the actor.
* Closures defined within an actor method are considered to be a
context distinct from the actor itself, are therefore are subject to
the same restrictions as above.
Together with a scheduler that ensures that asynchronous invocations
for a particular actor are serialized (at least up until they hit a
suspension point or return), this serves to isolate the actor's
instance state in a shallow manner: references to shared mutable state
can still be passed among actors, code can access global variables,
and one can still form and pass around unsafe pointers.
Pair this with some basic checking within actor contexts that
identifies a few obvious potential kinds of race conditions:
* References to captured mutable local variables from within closures.
* References to mutable global and static/class variables.
The latter are warnings, for which we currently don't have a great
suppression mechanism. That, and a lot of tuning, are still to come.
0 commit comments