多线程叉 [英] Multithreaded fork

查看:83
本文介绍了多线程叉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用fork()函数复制多线程进程.如果是这样,那么所有线程都将完全相同,如果不是,为什么不这样做.如果无法通过fork完成复制,是否还有其他功能可以帮助我?

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?

推荐答案

在派生后,子代中仅运行一个线程.这是POSIX标准要求.请参阅问题最佳答案. stackoverflow.com/questions/1073954/fork-and-existing-threads">fork和现有线程?.

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 ?.

这篇关于多线程叉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆