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. Database & SysAdmin
  3. System Admin
  4. Thread in DLL

Thread in DLL

Scheduled Pinned Locked Moved System Admin
tutorialperformancequestion
2 Posts 2 Posters 2 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I have DLL, when some independent processes sharing some informations. I need create in this DLL primary thread, which will modified these information. When I use DLL entry point for first time, thread is depend on process, which create it. When this process quit thread quit too. Can be created some thread which running for example in system memory space? And how to do it. Thanks a lot:-O Zbynek

    J 1 Reply Last reply
    0
    • L Lost User

      I have DLL, when some independent processes sharing some informations. I need create in this DLL primary thread, which will modified these information. When I use DLL entry point for first time, thread is depend on process, which create it. When this process quit thread quit too. Can be created some thread which running for example in system memory space? And how to do it. Thanks a lot:-O Zbynek

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

      Hello Zbynek, First of all, I assume your DLL has some shared data (using a technique like the one described in How to share a data segment in a DLL, for instance) --otherwise, your question makes little sense. That said, maybe the following technique will work: Have a shared global variable (with proper CRITICAL_SECTION-controlled access) that keeps track of how many processes are currently attached to the DLL. When this count is one (i.e., upon launching of the first process) make your entry point launch a special process (with CreateProcess) that in turn loads the DLL and creates the service thread (or does the required job at its primary thread). This "service" process can then quit when all other "normal" processes abandon the DLL. Make the service process a non-GUI one and the scheme will go unnoticed. I hope I made myself clear enough. Let me know it this did help. 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