CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Dynamically Creating Worker Processes

  1. #1
    Join Date
    Sep 2000
    Location
    Indianapolis
    Posts
    6,741

    Question Dynamically Creating Worker Processes

    A friend asked me the following. I didn't have a good answer, so I thought I'd ask you. Thoughts?


    Iíve been using AppDomains as an approach to isolation Ė but I may be reaching the end of that so Iím looking at potentially spinning up worker processes and hosting the code in another process. Do you happen to know of any good guides/coverage for dynamically creating worker processes?
    Any thoughts or insights are appreciated. As a note, my friend has been having an issue with a thread that keeps disappearing mysteriously within his app domain. It is running and then is just gone - everything about the thread is simply gone. As such, he is trying to find a different approach.

    Thanks in advance!

    Brad!
    -----------------------------------------------
    Brad! Jones,
    LotsOfSoftware, LLC
    -----------------------------------------------

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,356

    Re: Dynamically Creating Worker Processes

    Rather than spawning off separate process, it might be just easier to figure out why his 'thread is just gone.'

    Threads don't just disappear, Windows will keep them running if they don't crash, and the thread variable doesn't go out of scope.

    So does the code catch thread exceptions and prevent the thread variable from going out of scope?

    Lastly a thread will exit when its thread proc returns. For it to keep running, the thread has to loop. Usually, a thread waits on an event, wakes up, does some work, goes back to sleep and waits on the event again. Does this thread do this?
    Last edited by Arjay; June 6th, 2020 at 12:40 PM.

  3. #3
    Join Date
    Sep 2000
    Location
    Indianapolis
    Posts
    6,741

    Re: Dynamically Creating Worker Processes

    He ended up finding a big memory leak. His thread was literally disappearing. He believes his entire AppDomain was getting killed. He said a lot more, but I believe he has found an alternative at this point.

    Thanks.

    ( I would have responded sooner, but I was having strange issues logging into this forum.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)