Any Lessons and Tips Through Regular Posts

?max-results=10">Advertisement
');
    ?max-results="+numposts8+"&orderby=published&alt=json-in-script&callback=recentarticles7\"><\/script>");

Showing posts with label Operating System. Show all posts
Showing posts with label Operating System. Show all posts

Wednesday, March 30, 2016

Explain Deadlock Modelling and Strategies along with an example


As stated in previous topic, in Deadlock situation, a process waits resources which are using by other process without releasing its own resources. It is therefore causes all the processes waiting and waiting for the resources of each other; hence it brings critical condition to make deadlock condition.

In this chapter, we are going to model deadlock condition by using directed graph. Here we use directed graph to show whether it is requesting resources or holding resources. And circle are used to denote process whereas rectangle refers the resources.


Deadlock Modelling
Fig: Block Diagram of Deadlock Modelling
Above diagram shows the modelling process of deadlock, it shows requesting and holding of resources in/from a process. In the figure, A process is requesting T resource one time. In the bottom fig, A is holding T resource.


In fact, there is not solution of deadlock condition, that is why it is known as non-resolving situation. But a good programmer must be known with this fact before working on any project. S/he must be careful about the dealing of deadlock. A programmer has to consider 4 strategies to deal with deadlock. They are as follows:

  1. Ignoring the deadlock problem
  2. Detection and Recovery
  3. Avoiding Dynamically with Resource Allocation
  4. Prevention of Deadlock
Above four strategies are common and most important part of a programmer. S/he must apply one of these strategies which helps them to deal with deadlock. But among them prevention and dynamic avoidance are the best away of dealing with deadlock because it does not let deadlock condition to occur in a task like the speech "Prevention is better than cure". 

Ignoring can not be solution of any problem; ignoring of that problem obviously damages and lose something of your task. Detection and recovery somewhat can get back your data and information by detecting that deadlock. Allocating resources carefully in the different processes, a programmer can keep away the task out of the deadlock condition dynamically.

Monday, March 28, 2016

Define and explain Deadlock and its conditions


Deadlock Condition - Vehicle on Deadlock
Deadlock Situation
In Operating System, Deadlock is a non-resolving condition in which two or more competing actions are each waiting for the other to finish and thus neither ever does. However, deadlock condition must be prevented before it falls.

Basically, computer system make of resources; the resources of computer system can be categorized into different two types - Software Resources and Hardware Resources. Hardware Resources are external memory, printer, scanner etc. Software Resources are some applications, such as microsoft words, excel, adobe Photoshop etc. In the real time operation, each and every process needs resources that is why process shares the resource to complete the job mostly in multiprogramming system.

In conclusion, deadlock is only then arise if there are 2 process sharing the same resources, in which one process waits to use a resource which is using by another process whereas it itself does not release its own resource.

According to Coffman, deadlock has 4 conditions. They are:
  1. Mutual exclusion condition
  2. Hold and Wait Process
  3. No-preemption condition
  4. Circular wait condition
Conditions are the facts that must be available to occur a particular action. In the first point of above list of deadlock condition, there is a point "Mutual exclusion condition". It is a situation in which a resource is either using by a process. "Hold and Wait Condition" refers that a process is holding a process and waiting for another process. "No-preemption condition" means a process that can not be halted without damaging any task. And the last condition is "Circular Wait Condition". In circular wait condition, the process resources must be circulated from one process to another. 

Sunday, March 27, 2016

Define Operating System. List out its types and explain services.


basic block diagram of operating system
Block Diagram of Operating System
Generally, operating system works as an inter-mediator between computer and users. Actually, it is a group of software or applications that handles all the computer hardware and services of computer programs. Allocation of memory and controlling them is one of its basic service. In fact, Operating System can be categorized according to their processing nature and brand.

A. On the basis of processing nature, the types of OS are as follows:

  1. Real Time OS
  2. Multitasking OS
  3. Network OS
  4. Distributed OS
  5. Batch Processing OS
Except these five, there are also other types of operating system like, multi-processing os, multi-programming os etc. However, these are the basic types of Operating System

B. On the basis of brand, the types of OS are categorized as below:
  1. Windows OS
  2. Iphone Operating System (IOS)
  3. Android OS
  4. MAC OS
  5. Linux OS
  6. Unix OS
These six operating systems are also common types of operating system now available or used in IT field. Among them, IOS, and Android are mostly used as operating system of Smartphones. However, windows OS is both used in smartphone and desktop or computer. MAC, Linux, Unix are mostly used in desktop. Linux and Unix are mostly preferred by network programmers. 

Services in the terms of Operating System are executing program, running IO operating, establishing communication, manipulating files, detecting errors, allocating resources, protecting data and information etc.

1) Protection of Data and Programs:
Obviously, data and information have to be protected from various viruses and malware. It is common but most essential service of an OS.

2) Resource Allocation among users and processors:
Resource allocation needs frequently if an Operating system is working on the multi-programming, multi-processing or time-sharing environment.

3) Error Debugging: 
There may be lots of bugs into a programs and application and they must be checked and corrected. Error debugging is actually a process of finding bugs and correcting. An OS must have ability of error debugging.

4) Establishing Communication: 
Nothing is possible without communication. An OS must provide communication services. It is frequently need in a distributed environment. OS routes and makes an way of establishing of communication between two systems. Communication may be between two different devices or different processes of a single system. 

5) Manipulation of Files: 
File contains collection of data and information. Files must be saved into a computer memory. Users should have facility to store, delete and update that information. And all these are made possible by operating system.

6) I/O Service: 
In a computer, users can give input, s/he can takes output for a particular purpose. There are many device drivers used in an Operating System to facilitate this service. Device driver operates a hardware on the basis of operating system. Operating system gives accessibility to that device.