Article View: comp.os.os2.programmer
Article #3127Recovering a Dead Thread's Stack, etc.
From: Kenneth Porter
Date: Mon, 20 May 1991 07:01
Date: Mon, 20 May 1991 07:01
13 lines
982 bytes
982 bytes
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)
Technical Details
Message-ID:
<24884@well.sf.ca.us>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!olivea!apple!well!shivaShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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