[e-lang] Q: asynchronous tail recursion?

Kevin Reid kpreid at mac.com
Tue Jan 2 11:09:23 CST 2007


On Jan 2, 2007, at 11:30, Mark S. Miller wrote:
> Kevin Reid wrote:
>> My answer is that it depends on the type of incoming reference.
>> Remote weak references would have their own incoming and outgoing
>> tables. The incoming table would be weak-valued.
>>
>> When you make a weak reference, the maker would note that the target
>> is a Far-proxy, and requests the ref's comm system to make a weak
>> outgoing reference.
>
> IIUC, what you're proposing is essentially a normal far reference  
> to a weak-reference object, which itself would be local to the  
> object it designates. Once we support genuine Data-E  
> PassByConstruction, this should be an adequate hook for causing the  
> remote creation of such a weak reference. AFAICT, this should work  
> fine.

As far as I can think, you're right. Further refinements such as  
discarding the table entries as soon as the weak ref breaks can be  
implemented nonprimitively.

> If each of the participating vats are doing local tail-recursive  
> promise shortening, as you've implemented, then this should combine  
> with the distributed promise-chain shortening already implemented  
> by CapTP (as driven by __whenMoreResolved messages) to prevent any  
> accumulation. Perhaps I misunderstand the example?

I was not certain that CapTP did prompt shortening. How does it avoid  
the wMR reactors you mention retaining otherwise-garbage promises?

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list