Monday, January 21, 2008

1. Deadlock a problem occuring when the resources needed by some jobs to finish execution are held by other jobs , which, in turn, are waiting for other resources to become available. Also called deadly embrace. Starvation the result of conservative allocation of resources in which a single job is prevented from execution because it's kept waiting for resources that never become available. Race a synchronization problem between two processes vying for the same resource.
2. *Deadlock example - a traffic cituation of vehicles in a highway.
*Starvation example - a cituation in a dining table with one food served to 5 people using 5 utensils only but 2 utensils each. This results to the starvation of some people.
*Race example - a cituation that has a competition between 2 persons for only one source of food.
3. Four Necessary Conditions for Deadlock: The presence of deadlock in a systems is characterized by these four necessary conditions. The term necessary means that if there is deadlock then all four must be present.a. Mutual exclusive resource access - A resource acquired is held exclusively, i.e., it is not shared by other processes.b. No preemption - A process' resources cannot be taken away from it. Only the process can give up its resources.c. Hold and Wait - A process has some resources and is blocked requesting more.d. Circularity - This means that there is a circular chain of two or more processes in which the resources needed by one process are held by the next process.
4. Algorithm for prevention of deadlock and starvation: public boolean tryAcquire( int n0, int n1, ... ) { if ( for all i: ni ≤ availi ) { // successful acquisition availi -= ni for all i; return true; // indicate success } else return false; // indicate failure}init) Semaphore s = new Semaphore(1,1);Thread A Thread B-------- --------s.acquire(1,0); s.acquire(0,1);s.acquire(0,1); s.acquire(1,0);Thread B--------while(true) {s.acquire(0,1);if ( s.tryAcquire(1,0) ) // if second acquisition succeedsbreak; // leave the loopelse {s.release(0,1); // release what is heldsleep( SOME_AMOUNT); // pause a bit before trying again}}run action s.value--- ------ -------(1,1)A s.acquire(1,0) (0,1)B s.acquire(0,1) (0,0)A s.acquire(0,1) A blocks on secondB s.tryAcquire(1,0) => falseB s.release(0,1) (0,1)A s.acquire(0,1) (0,0) A succeeds on second.
5. a. Based on the figure, deadlock may occur.It can be happen when traffic controllers who control the traffic lights will be out of control that may result to a traffic or in a computer environment, a deadlock.
b. It can be detected if cars passing on both roads are stock that they cannot move.
c. To prevent a deadlock, traffic controllers must asure the controls of the traffic lights to be clear and fine.
6. a. This is not a deadlocked.
b. There is no blocked processes.
c. P2 can freely request on R1 and R2.
d. P1 can freely request on R1 and R2.
e. Both P1 and P2 have requested R2.1. P1 will wait after the request of P2.2. P2 will wait after the request of P1.


by: kurt enanoria

Monday, January 14, 2008

Current literature for the name of the first operating system to power an electronic computer.

Mac OS as well as Mac OS X, Apple's more recent operating system. See the Mac OS X article for information directly relating to this current Macintosh operating system.


Mac OS is the trademarked name for a series of graphical user interface-based operating systems developed by Apple Inc. (formerly Apple Computer, Inc.) for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface. The original form of what Apple would later name the "Mac OS" was the integral and unnamed system software first introduced in 1984 with the original Macintosh, usually referred to simply as the System software.
Apple deliberately downplayed the existence of the operating system in the early years of the Macintosh to help make the machine appear more
user-friendly and to distance it from other operating systems such as MS-DOS, which were portrayed as arcane and technically challenging. Much of this early system software was held in ROM, with updates typically provided free of charge by Apple dealers on floppy disk. As increasing disk storage capacity and performance gradually eliminated the need for fixing much of an advanced GUI operating system in ROM, Apple explored cloning while positioning major operating system upgrades as separate revenue-generating products, first with System 7 and System 7.5, then with Mac OS 7.6 in 1997.


From Wikipedia, the free encyclopedia(Redirected from Macintosh operating system)