[e-lang] E-on-Java: How to synchronously access a vat from an external thread?

Kevin Reid kpreid at attglobal.net
Sat Jun 25 12:11:29 EDT 2005


Simple description:

I have a Java thread from which I want to invoke a function written in 
E. The Java thread did not start out as an E runner thread.

I see two methods:

1.

Run the E code in its own default headless Vat/Runner and use some 
variety of inter-thread communication. The closest thing I've found is 
Vat#now/1, which does not provide for a return value.

I assume I need to use the 'boot-comm' system somehow, which I have not 
studied. How would I do this?

2.

Set up a Vat running in the original thread. I assume this would 
require writing a custom Runner that either stubs out eventual-sending 
or implements it on top of the original thread (which will have its own 
event loop).

For this method, how would I set up a Vat on a preexisting Runner?

(I assume this would be similar to the mechanism for AWT/SWT Runners, 
but that appears to be hardcoded, and also assume that there is only 
one such thread.)


The actual situation:

E-on-CL does not itself implement an E parser, and so uses the one 
implemented by E-on-Java.

For typical CL implementations, I use pipes to an external Rune 
process. However, I am attempting to add support for Armed Bear Common 
Lisp <http://www.armedbear.org/abcl.html> which runs inside the JVM.

I am attempting to load ABCL and E-on-Java in the same JVM and 
cross-call to the standard E parser. Therefore, I need to implement 
synchronous-to-the-calling-side access to either EParser itself or a 
stub on the E side.

So far I have an apparently successful imitation of Rune#main's 
initialization code, but that results in a vat with no 
inter-vat-reference-constraint-correct connection to my existing 
thread. Attempting to just call the parser results, as it should, in a 
"no current vat" error.

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



More information about the e-lang mailing list