










































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An excerpt from the eecs 678 fundamentals of operating systems course taught at the university of california, berkeley during spring 2009. It covers the concepts of processes, their states, and the importance of interprocess communication (ipc). Various ipc mechanisms, including message passing and shared memory, and provides examples using pipes and unix domain sockets.
Typology: Study notes
1 / 50
This page cannot be seen from the preview
Don't miss anything!











































l (^) is a program in execution l (^) is an instance of a computer program being sequentially executed l (^) process execution must progress in sequential fashion l (^) process is also called a job
l (^) program is a passive entity; process is an active entity l (^) program only contains text; process is associated with code, data, PC, heap, stack, registers, and other information l (^) program becomes a process when an executable file is loaded into memory l (^) same program executed multiple times will correspond to different process each time
l (^) new – process is being created l (^) running – instructions are being executed l (^) waiting – waiting for some event to occur l (^) ready – waiting to be assigned a processor l (^) terminated – process has finished execution
l (^) for time-shared or multiprogramming environments l (^) context of a process represented in the PCB l (^) context switch involves a state save of the current process, and a state restore of the process being resumed next l (^) switch from user to kernel mode or vice-versa is a mode switch
l (^) the system does no useful work while switching l (^) overhead depends on hardware support (^) Sun UltraSPARC provides multiple banks of registers (^) Intel x86 processors also provide some support
l (^) operating systems have a primordial process l (^) creating process called parent process l (^) new process called child process l (^) processes identified and managed via a process identifier ( pid )
l (^) parent and children share all resources l (^) children share subset of parent’s resources l (^) parent and child share no resources
l (^) parent and children execute concurrently l (^) parent waits until children terminate
int main() { pid_t pid; /* fork another process / pid = fork(); if (pid < 0) { / error occurred / fprintf(stderr, "Fork Failed"); exit(-1); } else if (pid == 0) { / child process / execlp("/bin/ls", "ls", NULL); } else { / parent process / / parent will wait for the child to complete */ wait (NULL); printf ("Child Complete"); exit(0); } }
l (^) information sharing l (^) computation speedup l (^) modularity l (^) convenience
l (^) typically, by sharing data
l (^) producer process produces information l (^) consumer process consumes the produced information
l (^) consumer cannot use information before it is produced by the producer
l (^) unbounded-buffer places no practical limit on the size of the buffer l (^) bounded-buffer assumes that there is a fixed buffer size