Professional Documents
Culture Documents
Ans:
Distributed Systems
Here all the computations are distributed among several processors. Distributed
systems are also referred as loosely coupled systems because the processors do
not share memory or a clock. Instead, each processor has its own local memory.
The processors communicate with one another through various communication
lines, such as high speed buses or telephone lines. The processors in distributed
system vary in size, function and are referred as sites, nodes, and computers and
so on.
Reasons for building distributed systems are:
a) Resource Sharing: If different users are connected to one another with
different resources, then the user at one site may be able to use the
resources available at another.
b) Computation Speedup: A particular computation will be partitioned into
number of sub computations that can run concurrently. In addition to this,
distributed system may allow us to distribute the computations among
various sites. It is called load sharing.
c) Reliability: If one site fails, the remaining sites will share the work of
failed site.
d) Communication: When many sites are connected to one another by a
communication network, the processes at different sites have the
opportunity to exchange information.
Real-time Systems
Real-time operating systems are specially designed to respond to events that
happen in real time. A real time operating system has well-defined, fixed time
constrains. Processing must be done within the defined constraints, or else the
system will fail. This feature is very useful in implementing systems such as an
airline reservation system. In such a system, the response time should be very
short because a customer's reservation is to be done while he/she waits.
There are two flavours of real-time systems. A hard real-time system guarantees
that critical tasks complete at a specified time. A less restrictive type of real time
system is soft real time system, where a critical real time task gets priority over
other tasks, and remains that priority until it completes. The several areas in
which this type is useful are multimedia, virtual reality and advance scientific
projects such as exploration and planetary rovers. Because of the expanded uses
for soft real-time functionality, it is finding its way into most current operating
systems, including major versions of Unix and Windows NT OS.
Q2) Explain the different process states.
Ans: A program in execution is a process. A process is executed sequentially,
one instruction at a time. A program is a passive entity. Example: a file on the
disk. A process on the other hand is an active entity. In addition to program code,
it includes the values of the program counter, the contents of the CPU registers,
the global variables in the data section and the contents of the stack that is used
for subroutine calls. In reality, the CPU switches back and forth among processes.
A process being an active entity, changes state as execution proceeds. A process
can be any one of the following states:
a)
b)
c)
d)
e)
Locally, the Running and Ready states are similar. In both cases the process is
willing to run, only in the case of Ready state, there is temporarily no CPU
available for it. The Blocked state is different from the Running and Ready states
in that the process cannot run, even if the CPU is available.
These above states are arbitrary and very between operating systems. Certain
operating systems also distinguish among more finely delineating process states.
It is important to realize that only one process can be running on any processor
at any instant. Many processes may be ready and waiting. A state diagram
(Figure 1) is used to diagrammatically represent the states and also the events
that trigger the change of state of a process in execution.
Fig 1
Q3) Define Deadlock. Explain necessary conditions for deadlock.
Ans: Several processes compete for a finite set of resources in a multiprogrammed environment. A process requests for resources that may not be
readily available at the time of the request. In such a case the process goes into
a wait state. It may so happen that this process may never change state because
the requested resources are held by other processes which themselves are
waiting for additional resources and hence in a wait state. This situation is called
a deadlock.
Deadlock occurs when we have a set of processes [not necessarily all the
processes in the system], each holding some resources, each requesting some
resources, and none of them is able to obtain what it needs, i.e. to make
progress. We will usually reason in terms of resources R1, R2... Rm and processes
P1, P2... Pn. A process Pi that is waiting for some currently unavailable resource
is said to be blocked.
Necessary Conditions for Deadlock
A deadlock occurs in a system if the following four conditions hold
simultaneously:
a) Mutual exclusion: At least one of the resources is non-sharable, that is,
only one process at a time can use the resource.
b) Hold and wait: A process exists that is holding on to at least one
resource and waiting for an additional resource held by another process.
c) No preemption: Resources cannot be preempted, that is, a resource is
released only by the process that is holding it.
d) Circular wait: There exist a set of processes P0, P1,... Pn of waiting
processes such that P0 is waiting for a resource held by P1, P1 is waiting
for a resource held by P2,... Pn-1 is waiting for a resource held Pn and Pn is
in turn waiting for a resource held by P0.
Q4) Differentiate between Sequential access and Direct access
methods.
Ans:
Sequential access
In this simple access method, information in a file is accessed sequentially one
record after another. To process the ith record all the i-1 records previous to i
must be accessed. Sequential access is based on the tape model that is
inherently a sequential access device. Sequential access is best suited where
most of the records in a file are to be processed. For example, transaction files.
Direct access
Sometimes it is not necessary to process every record in a file. It may not be
necessary to process records in the order in which they are present. Information
present in a record of a file is to be accessed only if some key value in that
record is known. In all such cases, direct access is used. Direct access is based
on the disk that is a direct access device and allows random access of any file
block. Since a file is a collection of physical blocks, any block and hence the
records in that block are accessed. For example, master files. Databases are
often of this type since they allow query processing that involves immediate
access to large amounts of information. All reservation systems fall into this
category. Not all operating systems support direct access files. Usually files are
Fig 2
Priority encoded bus arbitration
Here, each device has a request line connected to a centralized arbiter that
determines which device will be granted access to the bus. The order may be
fixed by the order of connection (priority encoded), or it may be determined by
some algorithm preloaded into the arbiter. Figure 3 shows this type of system.
Note that each device has a separate line to the bus arbiter. (The bus_grant
signals have been omitted for clarity.)
Fig 3
Q6) Differentiate between encryption and decryption. What are the two
basic methods for encryption?
Ans: Encryption means the original message is changed to some other form,
while decryption means the encrypted message is restored back to the original.
Example:
a)
b)
c)
d)
e)
f)