I'm using a 3rd party assembly to do some processing, and it spawns 2 child processes to perform some work. I'm running this in a separate thread.
I want to be able to cancel the processing if it runs for too long - my problem is that if I abort the thread the spawned processes are still running.
Is there a way to determine what processes were spawned by a specific thread so I can kill them?
I can perform the work in a separate Appdomain if that would help any - is there a way to determine what processes were spawned within a specific Appdomain?
Notes
- I have no way of getting the process IDs from the 3rd party assembly
- I cannot simply kill all processes matching a name, as I will be running a few of these worker threads concurrently (and if one runs too long I only want to kill the processes spawned in that thread)
- I know it's 'safe' for me to just kill these processes