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

    forking a process in an existing thread

    Hello

    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
    Posts
    1,902

    Re: forking a process in an existing thread

    It should work. You can read about what is and isn't inherited here: http://pubs.opengroup.org/onlinepubs...ions/fork.html

    gg

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

Featured