So I understand that CreateThread and the CRT can result in memory leaks, signal doesn't work, and one should use the _beginthread or _beginthreadex functions.
That is all very well when writing an application, but what about those that are writing dll's and such for other applications (be it a plain c dll, com objects, plugins, etc). There is no way to guarantee how a thread calling into a DLL was created, even if they used __beginthread(ex) its a pretty likely bet they have a different CRT implementation\version.
So what exactly is it that programmers are expected to do? Not use the CRT? Spawn an internal thread and offload all work to that (without using the CRT with the calling thread)? Some trick with DllMain and the attach/detach stuff to correctly setup and shutdown all threads regardless of how they are created?