Tuesday, January 15, 2008

Exercise 1-6

1.) What are the major differences between
deadlock, starvation, and race?
- Deadlock is more serious than indefinite postponement or starvation because it affects more than one job. Because resources are being
tied up, the entire system (not just a few programs) is affected.
- Starvation the result of conservative allocation of resources in which a single job is presented from execution because it's kept waiting for
resources that never become available.
- Race a synchronization problem between processes vying for the same resource.

2.) Give some real life examples of deadlock,
starvation, and race. Real-life Example of deadlock
- Client applications using the database may require exclusive access to a table, and in order to gain exclusive access they ask for a lock
- Bridge traffic can only be in one direction.
- Each entrance of the bridge can be viewed as a resource.
- If a deadlock occurs, it can be resolved if one car backs up (resource preemption(.
- a text formatting program that accepts text sent to it to be processed and then returns the results.

3.) Select one example of deadlock from exercise 2
and list the four necessary conditions needed for
the deadlock.
- Client applications using the database may require Exclusive access to a table, and in order to gain exclusive
access they ask for a lock. If one client application holds a lock on a table and attempts to obtain the lock on a second table that is
already held by a second application then attempts to obtain the lock that is held by the first application. (But this particular type of
deadlock is easily prevented, e.g., by using an all-or-none
resource allocation algorithm.)

4.) Suppose the narrow staircase has become a major source of aggravation. Design an algorithm for using it so that both deadlock and starvation are not possible.
-
5.)
A. Can deadlock occur? How can it happen an under what
circumstances?
- A deadlock can also occur if two processes access and lock
records in a database.

B. How can deadlock be detected?
- Deadlock can be detected by building directed resource
graphs and looking for cycles.

C. Give a solution to prevent deadlock but watch out for starvation.
- To prevent a deadlock the operating system must eliminate one of the four necessary conditions, a task complicated by the fact that the same condition can't be eliminated from every resource.
6.)
A. Is this system deadlocked?
- This system is deadlock because the graph can't be
completely reduce.

B. Are there any blocked processes?
- there's block process in this system.

C. What is the resulting graph after deduction by P1?
- The links between R1 and P1 can be removed, so R1 is
Released and allocated to P2, then P2 has all of its
requested resources can finish successfully.

D. What is the resulting graph after deduction by P2?
- The links between After P2 deducted, finally R2 is released and allocated to P1.

E. Both P1 and P2 have requested R2:
1. What is the status of the system if P2's request is granted before P1's?
- The status of the system if P2's request is granted then P2 finished and release R2, so finally P1 granted his request and finished.

2. What is the status of the system if P1's request is granted before P2's?
- The status of the system if P1's request is granted before P2's, P1 released R1, then P2 has all of it's requested resource is granted successfully.
The First PC Operating System

In 1974, Dr. Gary A. Kildall, while working for Intel Corporation, created CP/M as the first operating system for the new microprocessor. By 1977, CP/M had become the most popular operating system (OS) in the fledgling microcomputer (PC) industry. The largest Digital Research licensee of CP/M was a small company which had started life as Traf-0-Data, and is now known as Microsoft. In 1981, Microsoft paid Seattle Software Works for an unauthorized clone of CP/M, and Microsoft licensed this clone to IBM which marketed it as PC-DOS on the first IBM PC in 1981, and Microsoft marketed it to all other PC OEMs as MS-DOS.


This paper describes the first operating system was designed for the first internally programmed electronic digital computer: the EDVAC. This operating system was developed during 1952 and was implemented early in 1953. Devised for one of the earliest electronic digital computers, its capacities were modest compared to later standards, yet some of its features are recognizable in later operating systems. It was planned carefully, and it was comprehensive and useful in the context of its time.