Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!pyrltd!root44!praxis!graeme From: graeme@praxis.co.uk (Graeme Cutler) Newsgroups: comp.os.os2.misc Subject: Stopping processes Message-ID: <1991Mar4.151549.10409@praxis.co.uk> Date: 4 Mar 91 15:15:49 GMT Sender: graeme@praxis.co.uk (Graeme Cutler) Organization: Praxis, Bath, U.K. Lines: 30 I would like to be able to start different copies of the same process from threads in the same process. The process would effectively be a timer process which will clear a semaphore if the timer process times out on a DosSleep. However if the thread that started the timer process so wished I want the ability to kill the thread specific timer process. So I thought that any thread would call a function something like create_timer passing in a number of arguements. The function call would issue DosExecPgm and start a timer process, timer.exe. The function call would return the process id so that if the calling thread so wished it would be able to issue a DosKillProcess using the PID of the process it started. But I have (apparently?) misunderstood the RESULTCODES structure returned from issuing the DosExecPgm. I assumed that it returned the PID of the newly started process. Does not appear to(?) ;-( Now I have a problem. How can a thread issue a DosKillProcess and kill off its timer process? Can I use DosGetPIDD or DosGetPID ? sensibly? Especially as it will be used by threads in the same process trying to get info on their timer processes. A grotty way to resolve the problem would be to have unique timer process names, but what a dirty way of doing it. Unix handles this sort of thing much better ;-). Any suggestions of there? Graeme Cutler