简体   繁体   English

C-调用多个fork()调用时出现问题

[英]C - Problems with calling multiple fork() calls

I have a general question about the C fork() operation. 我对C fork()操作有一个一般性的问题。

If in a program, you have two separate methods that call fork(creating two children), would that cause any complications with the first call to fork() ? 如果在程序中,您有两个单独的方法调用fork(创建两个子代),那么第一次调用fork()会引起任何麻烦吗?

As in, trying to process the first fork() parameters in the second one? 就像在尝试在第二个中处理第一个fork()参数一样?

I am quite new to this concept in C, any explanations would be greatly appreciated! 我对C中的这个概念还很陌生,任何解释将不胜感激!

父级通过fork()系统调用创建的每个子级都是一个单独的进程,具有从父级共享或继承的某些资源,因此,如果您尝试操作任何数据,则该子级作为单独的实体不会引起任何复杂性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM