Re: Create Thread problem



In general, what you are proposing isn't doable for user mode. Put the
debugger in its own process if you must kill the parent process.

--
Ken Johnson (Skywing)
Windows SDK MVP

"Saurav" <ursaurav@xxxxxxxxx> wrote in message
news:1156503333.386523.324170@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
actually i also wanted to do that but that would be my last option.
That's why i want to change the parent process for the thread or make
the process orphan. If anybody is having any idea to it that ways then
please share with me.

Chris Becke wrote:
"Saurav" <ursaurav@xxxxxxxxx> wrote in message
news:1156494647.040814.85720@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks Ara for the reply. Actually problem is that i have created a
process which further creates a process in debug mode and a thread is
running in that parent process which receives all the debug events. But
the problem is that when the parent process is killed the debugger
thread is also getting killed which in turn kills the child process,
because killing the debugger will also kill the debugee. So i want that
even if the parent process gets killed the debugger thread should keep
running so that child process doesn't gets killed. I hope now you
understand the problem.

Then dont kill the debugger. i.e. dont kill the parent process.

Either re-architect the parent process such that the "main" thread calls
ExitThread() rather than ExitProcess() to exit (not that, simply
returning
from main()/WinMain() causes the CRT to call exit() which calls
ExitProcess() on your behalf.). This may leave too many resources
comitted
to that process, in which case, create a third process to host the debug
thread.



.



Relevant Pages

  • Re: Create Thread problem
    ... i Can't put the debugger in the process because i attach the debugger ... debugger in its own process if you must kill the parent process. ... Windows SDK MVP ... That's why i want to change the parent process for the thread or make ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Killing a process tree? - 1 attachment
    ... Well, you could use ps to get process and parent process pid, ... match subprocess to parent process, and kill in reverse order. ...
    (alt.os.linux)
  • Re: recursively kill the childs of a process
    ... >>> of this childs don't die so the parent process either. ... >> Just send a signal to the process group, ... If it's not a process group leader, then you won't kill any processes, ...
    (comp.unix.shell)
  • unable to Kill process
    ... process with nohup and their parent process id was 1. ... i was unable to kill them with kill -9 OR pkill ... i have tried taking the system to single user mode. ...
    (SunManagers)
  • Re: open office freeze
    ... > trick to killing a run away process like open office. ... > kill -9 it to no avail and killing its parent process only makes it ... There must be some way to kill a process ... if you do get a process stuck which won't go away when you ...
    (freebsd-questions)