Thursday, 15 December 2011

Deadlock Prevention


 Do not allow one of the four conditions to occur.

No preemption:

a)  Release any resource already being held if the process can't get an additional resource.
b)  Allow preemption - if a needed resource is held by another process, which is also waiting on some resource, steal it. Otherwise wait.

Circular wait:
 Number resources and only request in ascending order.
●
EACH of these prevention techniques may cause a decrease in utilization and/or resources. For this reason, prevention isn't necessarily the best technique.
Prevention is generally the easiest to implement.

Do not allow one of the four conditions to occur.


 Do not allow one of the four conditions to occur.
§
Mutual exclusion:
a)   Automatically holds for printers and other non-sharables.
b)   Shared entities (read only files) don't need mutual exclusion (and aren’t susceptible to deadlock.)
c)   Prevention not possible, since some devices are intrinsically non-sharable.

Hold and wait:
a)   Collect all resources before execution.
b)   A particular resource can only be requested when no others are being held.  A sequence of resources is always collected beginning with the same one.
c)   Utilization is low, starvation possible.

DEADLOCKS


Mutual exclusion
One or more than one resource must be held by a process in a non-sharable (exclusive) mode.

Hold and Wait
A process holds a resource while waiting for another resource.

No Preemption
There is only voluntary release of a resource - nobody else can make a process give up a resource.

Circular Wait
Process A waits for Process B waits for Process C .... waits for Process A.

Multiprocessor Operating Systems


•Consists of a set of processors that share a set of physical memory blocks & clock over an interconnection network.
•Controls & manages HW & SW resources such that users view it as a uniprocessor system.
•Design issues same as traditional system.
•Practical issues: increased complexity of synchronization, scheduling, memory management, protection and security.

Functions of an OS


•Resource Management:
–Time management - CPU and disk scheduling
–Space management - main and secondary storage allocation
–Synchronization and deadlock handling (Controlled Sharing) - IPC, critical section, coordination
–Accounting and status information - resource usage tracking
•User Environment - OS layer transforms bare hardware machine into higher level abstractions
–Execution environment - process management, file manipulation, interrupt handling, I/O operations, language.
–Error detection and handling
–Protection and security
–Fault tolerance and failure recovery
•User Friendly Interface

computer systems


•Hardware and software combine to solve specific problems
–Software: Application logic providing a service or solves some problem: entertainment, information management, scientific problem solving, system control, forwarding packets in a router, etc.
Although strictly speaking many solutions can be designed and implemented entirely in hardware but this is a course on operating systems.
–Hardware: provides the basic computing resources (Processor(s), Memory, System Bus and I/O modules).
•Software is divided into two categories:
–System software: simplifies application programming by creating convenient to use programming and run-time environments.
•Resource Management: time and space multiplexing of system resources
•Extended virtual machine: standardized interfaces and abstractions simplify programming and system use
–Application software: used directly by user (person, another program or computer system) to solve some problem.