TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Will Honea
from: Vitus Jensen
date: 1999-10-09 22:58:18
subject: VAC 3.0 Subsystem Librar

Hi Will,

08.10.99 00:40, Vitus Jensen wrote a message to Will Honea:

...
 WH>> Just be VERY careful of where you put your waits and be extra
 WH>> meticulous about cleanup on thread exit.  The biggest trap the
 WH>> programmers I work with fall into is misuse of shared memory -
 WH>> they just can't seem to clean up after themselves.  I think it's
 WH>> a carryover from using multiple processes rather than true
 WH>> threads.  Just to ease your mind a little, one comm job that
 WH>> gets done has been known to run over 100 threads in an iterative
 WH>> challenge-reply communications exchange and I've always been
 WH>> able to kill the process cleanly at any stage.  

 VJ> Actually I think memory allocation/cleanup, waiting (or not
 VJ> waiting) for threads to die is no complicate task.  You have to
 VJ> stop and think sometimes but, well, you write every line and
 VJ> there is always time to think (or should).
...

And if you did something wrong it shows up in a debugger and looks familiar.

I assumed a DosWaitEventSem() on a private semaphore will fail if called
during Exitlist processing.  After all there is no other thread which will
ever post that semaphore.  But OS/2 thinks different: just ERROR_TIMEOUT after 
some time of waiting...

Is there any special flag I should check?  Mhmm, that thread I started should
be dead during exitlist processing.  What resources are belonging to a
thread... only stack and the TID.  But no API DosQueryThread(tid,...). :-(

He, there is DosGetInfoBlocks and the PIB holds a bit saying "the current
process is in exit list processing". I will check this flag.

Bye,
    Vitus

--- Sqed/rexx 87:
* Origin: Windows NT? New Technology? I don't think so... (2:2474/424.1)

SOURCE: echoes via The OS/2 BBS

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.