Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DLL and TLS

DLL and TLS

Scheduled Pinned Locked Moved C / C++ / MFC
securityquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NicholasCougar
    wrote on last edited by
    #1

    Hi, I have three questions, 1.What happens when several threads use the same DLL? 2.race condition takes place during above situation? 3.The usage of TLS in thread and DLL. Plz in detail. Thank you. Best regard. I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.

    J 1 Reply Last reply
    0
    • N NicholasCougar

      Hi, I have three questions, 1.What happens when several threads use the same DLL? 2.race condition takes place during above situation? 3.The usage of TLS in thread and DLL. Plz in detail. Thank you. Best regard. I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      1. Nothing special. The DllMain entry point is called for each newly created thread with fdwReason set to DLL_THREAD_ATTACH. 2. No race conditions occur as calls to DllMain are serialized by the system. As a corollary, threads cannot be created inside DllMain. 3. TLS routines can allocate and deallocate indexes that are local to each running thread. These usually are used to map some dyamically allocated memory. Check MSDN article Using Thread Local Storage for details. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups