At 12:09 PM 9/28/2001 -0400, Barnabas Wolf wrote:
>I'm trying to add Python scripting capabilities to an existing Java
>application. I would need to be able to execute scripts fully
>independently in different threads. I've attempted this by creating
>an instance of PythonInterpreter in each of the threads. This approach
>appears to work, but not perfectly. For example, all interpreters
>share the same IO streams -- calling setOut(), setErr(), etc. on any
>of the interpreters will redirect *all* of the interpreters to the
>new stream. This particular problem is not a complete show stopper,
>but it makes me worry about how independent the interpreters really
>are.
That's the way threads are supposed to work: separate
threads of control within a single execution context,
which means they have a lot of resources in common,
including open files.
Mats
|