On Mon, Oct 08, 2012 at 04:12:13PM +0200, Igor Stasenko wrote:
> 
> Another question, why session id was not exposed to language by VM
> (your primitive in OSProcess plugin does that, but since plugin is
> optional, the question remains the same).

I don't know. Maybe nobody other than me ever wanted to use it ;)

The session identifier is exposed through the InterpreterProxy, so
it is part of the defined interface that is available to plugins.
FilePlugin (and SocketPlugin IIRC) uses this identifier in its data
structure to represent a file, so it provides a check to ensure that
a file reference was created in the current session.

I used this in OSPP because I wanted a separate plugin (not an extension
of FilePlugin or SocketPlugin) that could interact with those same data
structures. I did it that way because I wanted OSPP to be separate
from the VM and the standard plugins, so anybody could build it without
help from a VM guru. And I added the primitive so that I could do as
much of the work in the image as possible. I guess we think alike in
that regard ;)

> The proposed change is trivial to introduce and use, but what
> important, it don't requires altering VM.
> Altering VM in order to fix/improve session management, will
> immediately bring new issue: how to play nicely when running images
> which expect such feature to be present, while users (for no good
> reason, of course ;) using old/obsolete VMs to run image.
> 
> This is yet another thing which demonstrates that the less code you
> put in VM, the less you have to maintain and care less about
> compatibility issues.

I agree.

Dave


Reply via email to