|
|||||||||||||||||||
|
We generate |
Remote end generates OID and pos |
|
|---|---|---|
|
Outgoing remote ref.
We have tail, remote has head |
Questions |
Imports
t > 0 |
|
Incoming remote ref.
We have head, remote has tail |
Exports
h > 0 |
Answers
h < 0 |
There are four tables rather than two because of the orthogonal distinction that separates the columns. In order for a reference to span the inter-vat gap, one side, let's say Alice's vat, must first allocate an index for it in one of her tables, and then inform Bob's vat so Bob's vat can make the corresponding entry in the corresponding table. Bob's vat, of course, is doing likewise; so the two vats must be sure their allocations don't collide.
When Alice's vat allocates a place for the incoming (arrowhead) end of an object reference, she uses her Exports table. When Bob's vat hears about this, he follows her lead and makes the corresponding entry in his Imports table. When Alice's vat allocates a place for the outgoing (tail) end of an object reference, she uses her Questions table. Bob's vat again follows her lead and makes the corresponding entry in his Answers table. When would Alice find herself allocating an arrowtail vs an arrowhead? Let's say that Alice already holds a remote reference to Bob and a local reference to Carol (implying that Carol lives in Alice's vat as well), and Alice decides to send Carol to Bob in a message:
def result := bob <- foo(carol)
Alice's vat would allocate an index for Carol in her Exports table, since the reference to Carol must be pointing into Alice's vat. On the other hand, Alice's vat would allocate an index for result in her Questions table, since the outgoing reference to the result is in Alice's vat, but it is a RemotePromise (a kind of Promise) for a result whose value will be determined by Bob's response to the message.
| |
|
report bug (including invalid html) |
||||||||