kill a python script spawned from java/Jython

T

The Dude

ok, pretty new to python. in new job, took over some code, basically, it
spawns a LOT of little python scripts. parent java program is
multi-threaded.

Current code wraps pythonInterpreter into class which synchronizes exec()
method. Comments says he did this because was concerned about threading.

first, is this a good idea? comments?

Anway, we occassionaly seem to be having a "dead thread" and I wondered if
one of these python scripts is getting into an infinite loop or something
(before you say "go look at them" there are hundreds and hundreds executing
over and over. it's not even really an option to log each entry/exit. The
logs are just too huge. It would kill performance, which is already a
problem in production and it only occurrs in production.. So my thought was
to put a timer (maybe launch a class which sleeps and then kills the thread
once the scripts executes) and then kill the nonresponding python script.

So how do I do this. I see a PySystemState.exit() but this is a STATIC
method. So wouldn't it kill ALL executing scripts (remember, even though
this method is synchronized, there are other java threads, so wouldn't there
be others executing?).

Any thoughts would be appreciated. Just respond to group, as I wasn't able
to find much through googling on this topic, so let's fix that :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top