Re: orderlyShutdown question
Kevin Reid <kpreid-M/[email protected]>
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
On Jul 2, 2010, at 2:37, Thomas Leonard wrote:
> I'm having a bit of trouble with shutting down vats. Here's some test
> code:
>
> def makeVat := <unsafe:org.erights.e.elib.vat.makeVat>
> def seedVat := <elang:interp.seedVatAuthor>(<unsafe>)
>
> def test() {
> def [_, vat] := seedVat("5")
> println(`created vat $vat`)
> println(`shutting down vat $vat`)
> def result := vat<-orderlyShutdown("reason")
>
> return when (result) -> {
> println(`shutdown complete: $result`)
> test()
> }
> }
>
> test()
>
> interp.blockAtTop()
>
>
> The problem seems to be that once the vat is shut down, it doesn't
> respond to __whenMoreResolved, so the caller is never notified.
Is that a near or far reference to the vat object?
It's OK to use vat objects from other threads, so try having a near
reference instead. (And if that helps, then we can discuss the right
way to have that reference at hand.)
That said, it seems to me that having a reference into a dead vat (in
general, whether the ref is to a vat object or just some other object
in that vat) ought to resolve/WMR as a broken reference.
--
Kevin Reid <http://switchb.org/kpreid/>