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)
|