Re: DisableThreadLibraryCalls

From: Sajid (sajidbmsATyahooDOTcom)
Date: 08/30/04


Date: Mon, 30 Aug 2004 16:54:26 +0530

Hi Steve,

I have a doubt related to the thread creation in a process
with multiple DLLs loaded in its space.

When a thread is created in this environment,
would kernel notify ALL the DLLs in that process to
allocate TLS[thread local storage for the DLL] for that
thread OR the kernel notifies only the particular DLL for
TLS allocation ?

In case, the kernel notifies all the DLLs in that process,
what is its advantage in doing so, as all the DLLs
may not be used by that thread.

It would be most welcome if you can detail the thread
creation in a process of this environment.

regards
sajid

"Steve Maillet (eMVP)" <nospam1@EntelechyConsulting.com> wrote in message
news:O0Z5d4njEHA.632@TK2MSFTNGP12.phx.gbl...
> It does so by disabling thread library calls! ;-) Every time a thread is
> started after a DLL is loaded DllMain is called with a THREAD_ATTACH this
is
> used to allocate per thread local storage for the DLL. If the DLL doesn't
> need any (Typically the case) that overhead can be eliminated.
>
> --
> Steve Maillet
> EmbeddedFusion
> www.EmbeddedFusion.com
>
> Do have an opinion on the effectiveness of Microsoft Windows Mobile and
> Embedded newsgroups? Let us know!
> https://www.windowsembeddedeval.com/community/newsgroups
>
>



Relevant Pages

  • Re: Memory Management
    ... include the memory manager after any files that declare malloc etc. I'm not ... I have tried to export the operators from a DLL, ... I'm still using the CRT's malloc and free to allocate memory. ...
    (microsoft.public.vc.language)
  • Re: HOWTO: Notify owner from a DLL?
    ... >from the DLL to the client application. ... my receive thread would allocate memory ... >heap allocated string buffer. ...
    (microsoft.public.vc.mfc)
  • Re: HOWTO: Notify owner from a DLL?
    ... data back is to allocate data on the stack using new or malloc and when the receiver has ... pointer you passed back via PostMessage, and calls free or delete inside the DLL. ... Note that you cannot use a statically-allocated buffer or stack-allocated buffer in the ...
    (microsoft.public.vc.mfc)
  • Re: Odd behavior of getenv and putenv
    ... Recently I have observed some odd behavior of getenv and putenv function. ... This sounds like the modules (EXE, DLL) are using different CRTs and thus ... you could link everyone to the same CRT DLL so they would share CRT state. ... So it seems that getenvand systemlook at different environment. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: How do I set the environmet for a dll?
    ... KB-Q78542 (Retrieving MS-DOS Environment Vars from a Windows DLL) ... I don't think that setting things in the registry is going to ... > DllMain, I can't think of an elegant solution, but here are a couple of ...
    (microsoft.public.win32.programmer.kernel)