Вы находитесь на странице: 1из 7

ASSIGNMENT – 1

OF

DISTRIBUTED OPERATING SYSTEM


(CSE-537)

SUBMITTED TO: SUBMITTED BY:

Lect. Nandan Sujati Japneet Dhillon

Reg No. 10902350

RS1906A25

MBA(IT)
Part A

Q1. If a client and a server are placed far apart, we may see network latency dominating
overall performance. How can we tackle thin problem?

Ans. Network latency is the amount of time it takes for an application to make a request and the
server to respond with an acknowledgement (a packet message used in the transmission control
protocol to acknowledge receipt of a packet). If network latency does become a problem (slows
overall performance), there are things that can be done to improve the situation. Naturally, the
greater the distance between client and server, the more delayed the transmission will be.

It really depends on how the client is organized. It may be possible to divide the client-side code
into smaller parts that can run separately. In that case, when one part is waiting for the server to
respond, we can schedule another part.

Alternatively, we may be able to rearrange the client so that it can do other work after having
sent a request to the server. This last solution effectively replaces the synchronous client-server
communication with asynchronous one-way communication.

Q2. How does the distinction between kernel mode and user mode function as a
rudimentary from the protection (security) system?

Ans. By establishing a set of privileged instructions that can be executed only when in the
monitor mode, the operating system is assured of controlling the entire system at all times.
Kernel Mode

In Kernel mode, the executing code has complete and unrestricted access to the underlying
hardware. It can execute any CPU instruction and reference any memory address. Kernel mode is
generally reserved for the lowest-level, most trusted functions of the operating system. Crashes
in kernel mode are catastrophic; they will halt the entire PC.

User Mode

In User mode, the executing code has no ability to directly access hardware or reference
memory. Code running in user mode must delegate to system APIs to access hardware or
memory. Due to the protection afforded by this sort of isolation, crashes in user mode are always
recoverable. Most of the code running on your computer will execute in user mode.

The Operating system must ensure correct operating of the computer system. Hardware has two
modes to prevent user programs from interfering with the proper operation of the system, which
are user mode and monitor mode. Various instructions are privileged, and can be executed in
only monitor mode.

Monitor or privileged mode is implemented in hardware as a bit that indicates the operating
system is performing a privileged command. In user mode the bit is set to 1 and privileged
operations cannot be performed on certain hardware. But putting the operating system in
control of the monitor we can validate a user's request to access hardware. That is, the user must
request hardware access through the operating system since it is only this system that can run in
monitor mode. Thus, a user cannot access hardware without first having access to that hardware.

The distinction between kernel mode and user mode provides a rudimentary form of protection
in the following manner. Certain instructions could be executed only when the CPU is in kernel
mode. Similarly, hardware devices could be accessed only when the program is executing in
kernel mode. Control over when interrupts could be enabled or disabled is also possible only
when the CPU is in kernel mode. Consequently, the CPU has very limited capability when
executing in user mode, thereby enforcing protection of critical resources.

Q3. In the designing of the operating system there are two approaches modular kernel and
layered approach? How they are different?

Ans. The operating system is divided into a number of layers (levels), each built on top of lower
layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface.
With modularity, layers are selected such that each uses functions (operations) and services of
only lower-level layers.
The modular kernel approach requires subsystems to interact with each other through carefully
constructed interfaces that are typically narrow (in terms of the functionality that is exposed to
external modules). The layered kernel approach is similar in that respect. However, the layered
kernel imposes a strict ordering of subsystems such that subsystems at the lower layers are not
allowed to invoke operations corresponding to the upper-layer subsystems. There are no such
restrictions in the modular-kernel approach, wherein modules are free to invoke each other
without any constraints.
The components of layered operating system are organized into modules and layers them one in
top of the other. Each module provides a set of functions that other module can call. The layered
operating system structure with hierarchical organization of modules is shown below.

Layered Operating System

One advantage of layered operating system is that each layer of code is given access to only the
lower level interfaces it requires thus limiting the amount of code that wields unlimited power.
Nth layer can access services provided by N-1 layer and provide services to the N+1 layer.
Part B

Q4. Under what circumstances does a multithreaded solution using multiple kernel threads
provides better performance than a single –threaded solution on a single-processor system?

Ans. When a kernel thread suffers a page fault, another kernel thread can be switched in to use
the interleaving time in a useful manner. A single-threaded process, on the other hand, will not
be capable of performing useful work when a page fault takes place. Therefore, in scenarios
where a program might suffer from frequent page faults or has to wait for other system events, a
multi-threaded solution would perform better even on a single-processor system.

A multithreaded system comprising of multiple user-level threads cannot make use of the
different processors in a multiprocessor system simultaneously. The operating system sees only a
single process and will not schedule the different threads of the process on separate processors.
Consequently, there is no performance benefit associated with executing multiple user-level
threads on a multiprocessor system.

Another advantage of multithreading, even for single-CPU systems, is the ability for an
application to remain responsive to input. In a single threaded program, if the main execution
thread blocks on a long running task, the entire application can appear to freeze. By moving such
long running tasks to a worker thread that runs concurrently with the main execution thread, it is
possible for the application to remain responsive to user input while executing tasks in the
background. Another advantage of multithreading, even for single-CPU systems, is the ability
for an application to remain responsive to input. In a single threaded program, if the main
execution thread blocks on a long running task, the entire application can appear to freeze. By
moving such long running tasks to a worker thread that runs concurrently with the main
execution thread, it is possible for the application to remain responsive to user input while
executing tasks in the background.

Q5. Consider a system implementing multilevel queue scheduling? What strategy can a
computer user employ to maximize the amount of CPU time allocated to the user’s
process?
Ans. The program could maximize the CPU time allocated to it by not fully utilizing its time
quantums. It could use a large fraction of its assigned quantum, but relinquish the CPU before
the end of the quantum, thereby increasing the priority associated with the process. Another
answer would be to break a process up into many smaller processes and dispatch each to be
started and scheduled by the operating system.

In a multilevel queue scheduling processes are permanently assigned to one queues. The
processes are permanently assigned to one another, based on some property of the process, such
as

• Memory size
• Process priority
• Process type

Q6. How does synchronization works in the Windows XP.

Ans.

Вам также может понравиться