全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Fork?

Definition 13.5 University Computer Science — Year 2 · 第 13 章 — Processes and System Calls

A fork creates a new process by duplicating the caller. The system call fork() makes a child whose memory is a copy of the parent’s, with the same open files and working directory, and both processes continue from the return of fork. It returns 0 in the child and the child’s PID in the parent, or −1-1 in the parent, with no child, if it fails.

A fork of fork_basic.c. The two address spaces start equal, except for the value fork returned; the child’s assignment books = 20 does not reach the parent.
A fork of fork_basic.c. The two address spaces start equal, except for the value fork returned; the child’s assignment books = 20 does not reach the parent.
The process tree of fork_tree.c: an edge goes from a parent to a child. The fork of index i is made by every process alive at that moment, and doubles their number.
The process tree of fork_tree.c: an edge goes from a parent to a child. The fork of index ii is made by every process alive at that moment, and doubles their number.
在原文中阅读 →