You are on page 1of 6

Q1) Differentiate between Distributed Systems and Real-time Systems.

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)

New: Process being created.


Running: Instructions being executed.
Waiting (Blocked): Process waiting for an event to occur.
Ready: Process waiting for CPU.
Terminated: Process has finished execution.

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

to be defined as sequential or direct at the time of creation and accessed


accordingly later. Sequential access of a direct access file is possible but direct
access of a sequential file is not.
Q5) Differentiate between Daisy chain bus arbitration and Priority
encoded bus arbitration.
Ans:
Daisy chain bus arbitration
Here, the requesting device or devices assert the signal bus_request. The bus
arbiter returns the bus_grant signal, which passes through each of the devices
which can have access to the bus, as shown in Figure 2. Here, the priority of a
device depends solely on its position in the daisy chain. If two or more devices
request the bus at the same time, the highest priority device is granted the bus
first, and then the bus_grant signal is passed further down the chain. Generally a
third signal (bus_release) is used to indicate to the bus arbiter that the first
device has finished its use of the bus. Holding bus_request asserted indicates
that another device wants to use the bus.

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)

A wants to send a message to B.


A searches the database of public keys for the public key of B.
A encrypts the data using B's public key.
The cipher text is sent to B.
B receives this cipher text.
B decrypts the received cipher text using its private key and reads the
message.

Encryption could be of the following two basic methods:


a) Transposition ciphers
b) Substitution ciphers
In transposition ciphers the contents of the data are not changed but the order is
changed. For example, a message could be sent in reverse order like:
I am fine enif ma I
Rail fence cipher is a method that belongs to this class. The method is slow
because the entire message is to be stored and then encrypted. It also requires
more storage space when messages are long.

Substitution ciphers work by sending a set of characters different from the


original like:
I am fine r zn ormv
Caesar cipher is a popular method of this type. This method is fast and requires
less memory because characters can be changed as they are read and no
storage is required. Variations of this scheme are used for bit streams. Encryption
in this case involves adding a key to every bit stream and decryption is removing
the key from the cipher text. Thus every algorithm has a key. It must ensure
restoration. Normally a single piece of hardware is responsible for both
encryption and decryption.

You might also like