[gclist] GC in a Windows NT/95 threaded environment

dew wohlford@teleport.com
Wed, 13 Nov 1996 11:07:59 -0800 (PST)


--- From Prakash ---
conservative stop-and-copy gc is done. The problem I am facing is with
thread specific data. Windows NT/95 do not allow one thread to access
another thread in any documented form as far as I know. I think I can
get at the thread data by resorting to undocumented data structure
access and I am wondering if someone has a better solution.
--- hsakarP morF ---

Have you considered using the Win32 debug functions to catch
CREATE_THREAD_DEBUG_EVENT events?  You get a structure 
containing: a handle to the thread, a pointer P s.t. P+0x20
points to a pointer to the Thread local storage array.  The
structure also has an approximate starting address for the thread.
Anyway, you can use ReadProcessMemory to get at the
thread information, once you know where it is.

For the sake of your own sanity, I would only use the Pietrek tricks as
a last resort.  Some of the tricks he uses are very unstable, and
also very unportable between NT and 95.  You're best bet is to get
a copy of SoftICE-NT and stick to the NT platform.  I still think
that ReadProcessData is your best route to the threads
(sorry, threads')  specific information.

David Wohlford

--------
The opinions expressed are entirely mine and do not necessarily
reflect the views of Intel Corp.