Saturday, January 19, 2008

1. What are the major diffrences between deadlock, starvation, and race?
Their differences is deadloc is more serious than starvation because if affects more than one job. deadlocks can be happen if more process have done one at a time. starvation is the ooposite and of deadlock, it is the result of conservative allocation of resources where a single job is presented from execution because it's kept writing for resources that never become available.

2. Example of deadlock in real-life is traffic case.
Example of starvation in real-life is 5 students ordered 1 serve of soup and their are 5 spoons. when eating each students needs 2 spoons to eat the soup so they cannot eat altogether. one student will be wait until there is a 2 spoons that will be available.
Example of race in real-life is 2 guys compete in one girl.

5. a.) Deadlock cannot be occur because there is a street light that will guide all of the vehicle but starvation will occur.
b.) Deadlock can be detected if these vehicles stop and cannot continue running.
c.) The situation to prevent deadlock without starvation is avoid passing to that street if you know that deadlock always occur there.