Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!olivea!apple!well!shiva From: shiva@well.sf.ca.us (Kenneth Porter) Newsgroups: comp.os.os2.programmer Subject: Recovering a Dead Thread's Stack, etc. Message-ID: <24884@well.sf.ca.us> Date: 20 May 91 07:01:25 GMT Distribution: comp Lines: 13 How can I tell when a thread is dead and its resources (especially its stack) can be reclaimed? Presumably the thread can't free its own stack since it needs it to call DosExit(). One can't tell that a thread is dead by testing for its ID with, say, DosSuspendThread() (looking for the ERROR_INVALID_THREADID) since another thread might be created that would pick up a dying thread's ID. Presumably _beginthread() accomplishes the stack reclamation, since my company has an application that spawns short-run threads left and right with it and it doesn't lose memory over time. Ken (shiva@well.sf.ca.us)