From: Roland (roland.schwarz_at_[hidden])
Date: 2003-11-29 06:37:50
I've experimented a little with the threads library, and soon discovered, that it is not possible to use
the library in a static version on Windows.
I have read the conversations on this theme in the lists, and understand why this is not possible.
Nevertheless I have written a small lib, that will be helpful to make it possible to bind it statically.
Yet this library is in a state that just demonstrates the principle, but in no means can be said to have
an optimum interface or beeing robust (most error handling code, yet not implemented).
If there is any interest in the group to share and develop further these ideas I would like to contribute
the source. Please can anyone tell me, if I should simply load up the code to boosts file area? Do
I need special authorisation for this? I am not even sure if this code can ever be tought of beeing
boost code, since it "solves" only a platform relevant problem.
A short abstract:
I am embedding a very small (20k) binary of DLL stub into my library. When the process is starting up,
I copy the binary data to a temporary file (which has flag FILE_ATTRIBUTE_TEMPORARY, to
tell the operating system to keep it in memory, to be fast) and call LoadLibrary on this file.
I end up with a per process DLL (thereby avoiding the 64 Processes limit for the task local storage).
It is straight-forward now to install a callback function, that gets called whenever any thread (no matter
how it was created) is ending.
Altough this procedure sounds somewhat tricky, I am using only well documented interfaces.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk