[Isolate-interest] JSR-121 aggregates and links (strawman 10)

Miles Sabin miles@milessabin.com
Wed, 29 Sep 2004 20:09:16 +0100


Godmar Back wrote,
> A model where you pass rights might make some things easier also - in
> particular, it might simplify resource management for the application
> which then would not have to worry about closing/freeing/nilling.

Yes, but the downside is that it's only the application which knows what 
cleanup actions which are appropriate. Given a choice between having 
the runtime take a guess and sometimes get it wrong, or do nothing and 
let the application do whatever's appropriate, my preference would be 
for the latter.

> I am also wondering if preforked server models can't be accomplished
> in a different and more efficient way.  I've always thought of dup(2)
> as a Unix relict in the line of fork() - in other words, something we
> wouldn't repeat in a new design.

In principle I agree, but in practice we have to be able to implement 
this efficiently on top of existing OS infrastructure. We weren't able 
to come up with anything better ... but we'd be delighted if you or 
anyone else can.

> What about subtypes?  If the object being sent it a, say
> SSLServerSocket, will the object received by a SSLServerSocket also?
> Is the JSR-121 obliging all subclassers of Sendables to implement
> JSR-121 send semantics?

There's a fixed list of concrete types which are (little 's') sendable, 
so in many ways the (big 'S') Sendable interface is lying to you. At 
various times the method signatures that are now defined in terms of 
Sendable were instead defined in terms of Serializable, or Object.

In all cases there's a possibility of a runtime error. What we're trying 
to capture is a non-extensible gerrymandered union of more or less 
unrelated types ... and there's no way of capturing that cleanly within 
Java's type system. We also wanted to avoid having to mandate _any_ 
visible changes to types outside of the java.isolate packages, which 
meant that retrofitting an interface to all the (little 's') sendables 
wasn't an option even if it would have worked.

> Third, how does terminal control work when stdin FileDescriptors are
> exchanged between Isolates?

I vaguely remember we discussed this at some point, but I have 
absolutely no memory of what, if anything, we decided.

Cheers,


Miles