CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2005

    forking a process in an existing thread


    In C on *nix environment, can you fork a process from within a thread?
    Is the thread invoking the fork replicated only or everything in the process?

    What about heap memory - not directly allocated by the thread but can be referenced by it.

    From initial attempt the fork just stalls and does not return so no error number either.

    So wondering if it would work. Previously i hav only seen it done from main thread.

    Thank you for thoughts.

  2. #2
    Join Date
    Nov 2003

    Re: forking a process in an existing thread

    It should work. You can read about what is and isn't inherited here:


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

Click Here to Expand Forum to Full Width