In article <
462905.91284.qm <at> web112103.mail.gq1.yahoo.com>,
Anamitra Bhattacharyya <
ana_mitra <at> yahoo.com> wrote:
> System.out.println(a+"+"+b+"="+cs.getEngine().get("c")); - u sould see 4+5=13
> and 2+3=9 etc instead of nulls. BTW the rhino implementation says its
> "MULTITHREADED" too and still is giving correct out for this test. So do you
> think what I am trying to do is not valid as per the jsr 223 spec? OR there
> is some problem with the jython implementation of jsr223. Because if its the
> former - then I will have to use a pool of CompiledScript objects and that
> significantly complicates the implementation. If its the latter
then I am
> ready to make an exception for jython and code to the jython api ditching
> jsr223 for jython - if u say the jython apis [PythonInterpreter etc] would
> work for this. All I want
> to achieve is -
>
> 1>compile a script and cache it
> 2>have multiple threads execute that and I use the Binding object as my
> transport for IN and OUT params to the script.
It's just a problem with the Jython implementation the JSR 223 (and
PythonInterpreter, for that matter) front ends. There's nothing in
Jython itself that stops this from working. At the time I was working
on the JSR 223 implementation, I didn't understand the use case you are
describing. Now I do and I'll handle it.
If you can wait a couple of weeks I will get it fixed, otherwise I
suggest you just create your own per-thread locals/global Python
dictionaries (which
are what the Bindings end up getting mapped to) and
use them. If you look at the source code for PythonInterpreter it
should be clear what to do, otherwise please ask on the list.
--
Nicholas Riley <
njriley <at> illinois.edu>
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/jython-users