Multithreaded fork

MetallicPriest picture MetallicPriest · May 19, 2011 · Viewed 10.7k times · Source

Can fork() function be used to replicate a multithreaded process. And if so, will all threads be exactly the same and if not, why not. If replication can't be done through fork, is there any other function which can do it for me?

Answer

DarkDust picture DarkDust · May 19, 2011

After a fork, only one thread is running in the child. This is a POSIX standard requirement. See the top answer to the question fork and existing threads ?.