|
From: Mitch M <mit...@ho...> - 2004-08-02 13:58:52
|
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/opinions would be appreciated. _________________________________________________________________ Planning a family vacation? Check out the MSN Family Travel guide! http://dollar.msn.com |