CMPSC 32 Lecture Notes - Lecture 14: Orphan Process, Parent Process, Launchd

31 views4 pages
26 Sep 2017
School
Course
Professor

Document Summary

Do stuff for apps that only the os is allowed to do. All other processes are cloned from init using fork system call. To create a new process, an existing one (init, a shell, your app, etc. ) must: Returns the pid of the new process to the parent. Good way to create lots of copies of a process. #include pid_t pid = fork(); if (pid = 0) { Child calls exec() to replace its code with new code. Call wait() periodically to see if child has ended. Orphan process = one whose parent process has exited. Zombie process = a child process that has exited but its parent doesn"t know. Sometimes recent cpu usage also added to priority. Normally when you run a command, the shell waits. foreground command fg man fg fg is a shell command. Can see them all with the jobs command. You accidentally forgot the & and started a long, slow program.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents