Operating Systems - CS550 Class Notes For Week1
Operating Systems - CS550 Class Notes For Week1
Examining Process: Now the processes are running and there are many ways we
can examine a process. Some of the commands which are used in this are ps, /proc,
top etc. Top command gives the result of processes in a sorted order of CPU usage.
When a user wants to execute a command in shell the parent process first creates a
child process and the child process finds the corresponding bin for the entered
command. Now the child process image is replaced by the new program image. This
is done using exec (). But this method is not efficient since we are making 2 calls
here. If in case we have some files open before an exec function call we still have
the files open even after the exec call, OS takes care of this file systems. This is one
nice feature of exec call, not everything in is replaced by new program image.
Wait System Call: Wait system call allows the parent to know the status of the
child and also to know when the child process completes.
Apart from the above two system calls there are some more useful system calls like
sleep, exit etc. Exit call accepts two types of status 0 and 1 where 0 is for normal
status and 1 for any error.
Orphan Process: A child process is said to be an orphan process if it parent
process has died.