线程启动子进程我有一个情况如下:是好从主过程
main()
{
create a thread executing function thread_func();
another_func();
}
another_func()
{
//check something and do something.
// To do something, create a child process.
// after creating child process, current thread goes in checking state again
// child process independently running.
}
thread_func()
{
infinite loop(); // checking something and doing something
}
线程使用并行线程创建。 请告诉:这是好的开始像上面一个子进程中的一个线索?如果这样做也会发生什么。
是否子进程创建其自己的另一份线程执行thread_func()?
感谢
你可能有兴趣阅读[恰好给其他线程什么当一个线程叉()?](https://stackoverflow.com/questions/10080811/what-happens-to-other-threads-when-one-线程叉) –
此链接也可能是有用的。 https://stackoverflow.com/questions/39890363/what-happens-when-a-thread-forks –