dplyukhin / UIGC

A garbage collector for Akka actors!
Other
4 stars 2 forks source link

Change the default equality for ActorRefs #26

Closed dplyukhin closed 1 year ago

dplyukhin commented 4 years ago

Folks using vanilla Akka expect that two actor refs are equal if and only if they refer to the same actor. Currently, our ActorRefs only satisfy the (=>) direction; you can have two actor refs pointing to the same actor that have different tokens. (Technically they could have different owners as well, but I think it's safe to assume that actors only have access to refs that they own.)

This bug should preferably be completed after Issue #9, for the following reason. Suppose we implement the change described above and then have a set, Set[ActorRef], in which we place two actor refs that point to the same actor. The set will only store one of the refs, silently dropping the other. I think it would be unreasonable to ask users to keep this possible behavior in mind, so we should have refs automatically release themselves when they become unreachable.

We might also want to fix Issue #6 first, because it may change how ActorRefs are supposed to be used.