Parbegin / person learns, is a structure to indicate the parallels, indicate the beginning and end of a parallel execution Selection:
- A statement indicating that the sequential execution must be divided between several parallel execution streams.
Its overall shape (DijkstraJ follows:
parbegin Proposición1; proposicion2; Proposition n; person learns
Mutex: occurs when each process is sharing data impidea accediendoal Disable ALL others to do so at the same time. Applies when a process accesses the shared data when the processes execute transactions that are not in dispute are allowed to proceed concurrently.
Critical sections: when a process is accessing shared data. When a process is in a critical section:
* All other processes are excluded from their own critical sections.
* Other processes can continue execution outside their critical sections. When a process leaves its critical section, then you should be allowed to proceed to the next process waiting to enter its own critical section.
* State special allowance granted to a process. The process has exclusive access to shared data, and all other processes that require access to such data remains on hold.
* A program should not be blocked in its critical section, and critical sections must be carefully coded.
* And it ends, both voluntarily and involuntarily, then, to make cleaning of termination, the operating system must release the mutex so that other processes can enter their critical sections.
Deadlock (deadlock) is when the process is waiting for a particular event will not occur. In the deadlock of a system are in a tight situation or more processes.
REVENGE: PROCEDURE OPTIONS (MAIN TASK), WAIT (EVENT); END REVENGE;
Traffic Deadlock
The most common standard on the road is a car at a junction of four roads must yield to the car that is on your right. This rule works if only two or three cars at the crossing. For example, if you only get the cars crossing the north and west, north car will wait until the west pass. However, if the four cars arrive at the same time everyone will refrain from entering the intersection, causing deadlock. If all the cars ignore the rules and go (carefully) at the crossroads, each car will get a resource (one quadrant) but you can not continue because the second resource needed has already been invaded by another car. Again, there is deadlock.
Deadlock of a simple appeal: many of the deadlocks that occur on an operating system may develop due to normal restraint of resources allocated (ie, resources that can be used by a user at a time, sometimes calledusable resources in series).
* Can be used by one user at a time.
* Each process is waiting for the other to release a resource.
* The resource held will not be released until the other user releases his appeal process.
* This last process your application user does not release withheld until the user releases his first appeal process retained.
* There is a circular wait
Detection of the blockade: is whether or not a lock to identify what processes and resources are in the process bloqueo.Cualquier part of a cycle is blocked, if there are no cycles, the system is not locked.
A related problem: Indefinite Postponement: in a state of the system that keeps the process while the processing resource allocation planning decisions. It is caused by the skew of the planning policy system resources.
PI avoid implementing aging increases the priority of a process while waiting for a resource.
Interlock systems spool: are used to increase the implementation capacity of the system, to disassociate a program of the slow speed of operation devices.
Spool-systems are prone to deadlock.
"To accelerate the implementation of each output lines are sent to a faster device, a disk drive, where they are stored temporarily until they can be printed.
"Several partially completed work that generate lines of print can be interlocked if space is filled before completing the work.
"Unravel or recover from such a deadlock may involve restarting the system with the loss of all the work previously done.
"If the system hangs in such a way that leaves the operator in control, then a less drastic way to recovery may be losing one or more jobs, to have enough space on the spool file for the remaining work to reach completion.
"When an operating system is generated by the program, the system specifies the amount of free space for spool file.
-How to reduce the likelihood of deadlocks is to provide a space for the files considerably larger than expected needed.
"The most common solution is to limit the spoolers to read no further work when spool files are saturated, 75 percent of capacity.
"This can reduce the ability to implement the scheme, but the price to pay to reduce the likelihood of deadlocks.
"Current systems are much more sophisticated. Allow printing to start before the end of a job, so a full spool file, or almost full, can be emptied or cleared in close as if a job is still running.
"In many systems, the spool space allocation has been made more dynamic so that if the gap has begun to fill, more space may be available.
Four conditions for deadlock: Coffman, Elphick and Shoshani four conditions to produce a deadlock:
* The processes claimed exclusive control of the resources requested (mutual exclusion condition).
* Maintain processes and resources have been allocated additional resources as they wait for (wait for condition.)
* The resources can not be extracted from the processes that are up to their full utilization (not apropiatividad condition).
* There is a circular chain of processes d holds one or more resources required by the following process in the chain (circular wait condition).
Deadlock recovery: There are several factors hindering the recovery of the deadlock:
* First, it may be unclear whether the system has crashed or not.
* Means poor to suspend indefinitely a process and resume it later.
* Although there are effective means suspend / resume, this will involve considerable overhead and require attention by an operator.
* Recovering from a modest deadlock reasonable amount of work involved; deadlock on a large scale requires a tremendous amount of work.
Processes can be removed in accordance with an order of priorities.
* The blocked process priorities may not exist, so the operator must make an arbitrary decision.
* The priorities may be incorrect, or a little confusing due to special considerations, such as fixed-term planning, in which some relatively low priority processes have a momentary high priority because of an imminent deadline.
* The optimal decision processes which may require removing a considerable effort to determine it.