Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Fork » ?

Definition 13.5 University Computer Science — Year 2 · Chapitre 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.
Lire dans le chapitre →