Thanks for the quick responses guys.
Its late in the day here so I will read over them tomorrow and get back
to you.
My main issue is that the threads my app (and its a testing app) spawns
have the same name as the original running app. Long story short I dont
have much control over the environment, but recently I have been looking
to move to runit to try and clean the tests up, but what I have found is
originally the app ran as a ruby process from the command line (process
name was 'ruby'), spawning 'rubyw' processes. Now becuase eclypse runs
runit tests as a rubyw process (test and spawned threads now have same
process name), the code which killed off the old child processes is
acually killing the test itself.
I'd still advise a step further back. What are you trying to achieve
that means you have multiple threads or processes, or jobs, or .....?
And, why do you have to kill them? Why can't they be allowed to complete?
If you must kill them based on time, use Timeout.rb .
As I said, I dont have full control over the environment (financial
company who are strict about OS types and approved technologies) so I am
somewhat limited in my options (win 2k is a nightmare).
Will they let you use Windows Powershell instead? Given that it's native
you may find it easier than trying to get Ruby to do what you want.
I can't remember if Win2k has CMD.exe and how sophisticted it is if it does.
So if anyone knows a better way to launch a new thread which I can
kill/terminate so it no longer appears in the process list, I am all
ears.
You've not really said what the problem you are trying to solve with this
is. If the jobs are ruby programs, then they might stay strictly within
threads in the same process.
Thanks, and as I said I have not ahd a chance to review the responses.
Hugh
···
On Tue, 4 Nov 2008, Dave Wilson wrote: