COP4600_21-5 - COP4600 21-5-10 Processes & threads...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COP4600 21-5-10 Process life-cycle Process termination 1) normal exit (voluntary) 2) error exit (voluntary) - program has detected an error and shuts down gracefully exit( error_code ) - usually due to user error 3) fatal error (involuntary) - tend to be due to a programming logic error 4) killed by another process (involuntary) - reasons why this might occur * process has exceeded allocated resources * assigned task is no longer required * parent process is exiting - in general, OSen don't allow children to continue executing when their parent terminates. Thus, it's usually an error if a proc continues executing after it parent die -- such a process is known as an orphan process - in UNIX(like) OSen, orphans are immediately adopted by the init process -- reparenting . Zombie process is a dead process that has not yet been reaped * the process has ended - all memory and resources have been reclaimed * an entry for the proc remains in the process table * the parent is notified of the child's death (sent a SIGCHLD signal) - the handler for this signal has typically executed wait() - when the handler receives the signal, the zombie is reaped --i.e., removed from the process table. * zombies that exist for more than short period of time usually indicate a bug in the parent. Idealized Process Structured OS
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

COP4600_21-5 - COP4600 21-5-10 Processes & threads...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online