Sunteți pe pagina 1din 7

Distributed systems[1.

3]
It is depends on networking. Distributed system is used to share resource on network.
Network protocol and network adapter are need for distributed systems.
Types of network
LAN – Local area Network, exits with a room, a floor, or same buildings.
MAN – Metropolitan Network, could link buildings within a city.
WAN – Wide Area Network, usually exists between buildings, cities, or countries.
Transmission media that includes, copper wires, fiber strands, and wireless transmission
between satellites, dishes, and radios. Blue tooth and Infrared can be used for short
distance networking.
A. Client Server systems
Terminal (Client system) connected to centralized system, centralized systems act as
server systems to satisfy requests generated by client systems.
There are two types of system
i. Computer server systems – provide an interface to which clients can send request to
perform an action.
ii. File server systems – provide a file system interface where clients can create, update,
read, and delete files.
B. Peer-to-Pear systems.
It has a collection of processors that do not share memory or a clock.
Each processor has its own local memory and they communicate with one another
through various communication lines such as buses or telephone lines. These systems are
also refereed to as loosely coupled systems.

functions of operating systems.


The operating system functions are
Process management
Main memory management
File management
secondary storage management
I/O management
a. Process Management
Ø Process refers to a program in execution.
Ø A process is a unit of work in a system such a system consist of a collection of
processes which are Operating system processes and user process.
The operating system is responsible for the following activities of the process
management.
ü Creating and deleting the user and system process.
ü Allocating hardware resources among the processes.
ü Controlling the progress of processes.
ü Providing mechanisms for process communications.
ü Providing mechanisms for deadlock handling.
b. Main memory management.
Main memory(primary memory) management is concerned with following functions.
ü Keeping track of the status – Each memory location is either free or allocated.
ü Determining allocation policy for memory.
ü Allocation technique – specific location must be selected and allocation information
updated.
ü Deallocation technique – after deallocation, status information must be updated.
c. File Management.
ü Secondary storage are usually organized into named collections called files.
ü Computer uses physical media for storing the different information.
ü A file may contain a report, an executable program or a set of commands.
ü A file consists of a sequence of bits, bytes, lines or records.
ü Physical media is used for storing files.
ü Physical media are different types, magnetic disk, magnetic tape and optical disk.
The operating system is responsible for the following activities of the file management.
ü Creating and deleting of files.
ü Mapping files onto secondary storage.
ü Backing up files on stable storage media.
d. Secondary storage management.
Main memory is too small to accommodate all data and programs.
When power is lost, main memory lost data, so computer system must provide secondary
storage to backup main memory.
The operating system is responsible for the following activities of the secondary storage
management.
ü Free space management
ü Storage allocation
ü Disk scheduling.
e. I/O system management.
ü Keeping track the status of devices is called the I/O traffic controller..
ü Each I/O Device has device handler with that device.
I/O subsystem consists of
i. Memory management of I/O including buffering (storing data temporarily while it is
being transferred), caching (storing parts of data in faster storage for performance),
spooling (the overlapping of output of one job with input of other jobs)
ii. General device-driver interface
iii. Drivers for specific hardware devices

process concepts.[1.7]
An operating system executes a variety of programs:
l Batch system – jobs
l Time-shared systems – user programs or tasks
Textbook uses the terms job and process almost interchangeably.
Process – a program in execution; process execution must progress in sequential fashion.
A process includes:
l program counter
l stack
l data section
l heap
4. Write notes on process state.
As a process executes, it changes state
Ø new: The process is being created
Ø running: Instructions are being executed
Ø waiting: The process is waiting for some event to occur
Ø ready: The process is waiting to be assigned to a process
Ø terminated: The process has finished execution
5. Explain about Process state transition.
i. when a job admitted to the system, a corresponding process is created and inserted at
the back of the ready list.
ii. The the process moves to the ready list.
iii. When the process reaches ready list it uses the CPU.
iv. Then it is in the running state.
v. Dispatching – transition from ready to running.
vi. Time run out – Ready -> running state.
vii. Running -> waiting state (blocked ) if a running process initiates an input / output
operation, process is transferred to waiting state.
viii. Blocked -> ready state The transition is wakeup.
6. Explain about Process control Block.
OS maintains information about every process in a data structure called a process control
block

pointer process state

) Pointer points to the another process.


b) Process state – the state may be new, ready, running, waiting or terminated.
c) Program counter – Indicates the address of the next instruction to be executed for this
process.
d) Register – It includes general purpose register, stack pointer, index register,
accumulators etc..
e) CPU scheduling information – It includes a process priority, pointers to the scheduling
queues and other scheduling parameters.
f) Memory management information – This information may include the value of based
and limit register. This information is useful for the allocating the memory when the
process terminates.
g) Accounting information –amount of CPU and real time used, time limits, account
numbers, job or process numbers.
h) I/O status information – Includes the list of I/O devices allocated to the process.
7. Write notes on context Switching.
ü When CPU switches to another process, the system must save the state of the old
process and load the saved state for the new process.
ü Context-switch time is overhead; the system does no useful work while switching
ü Time taken dependent on hardware support
To switch between processes, the OS must
a) save the context of the currently executing process, and
b) restore the context of that being resumed.
Thread
A thread in computer is short for a thread of execution.
Thread is basic unit of CPU utilization.
• Each thread contains:
– an instruction pointer (IP), a register with next instruction.
– a stack for temporary data (eg, return addresses, parameters)
– a data area for data declared globally and statically
A thread is sometimes called a lightweight process
l It is comprised over a thread ID, program counter, a register set and a stack
l It shares with other threads belonging to the same process its code section, data section
and other OS resources (e.g., open files)
l A process that has multiples threads can do more than one task at a time
Benefits
Responsiveness
l One part of a program can continue running even if another part is blocked
Resource Sharing
l Threads of the same process share the same memory space and resources
Economy
l Much less time consuming to create and manage threads than processes
Utilization of Multiprocessor Architectures
l Each thread can run in parallel on a different processor
User and Kernel Threads
Threads may be provided at either the user level threads or by the kernel level threads.
1. User threads
Library provides support for thread createion, scheduling.
All thread creation and scheduling is done in user space.
User level threads are fast to create and manage.
2. Kernel threads
Supported directly by the operating system.
It performs thread creation scheduling and management.
Management is done by the OS, kernel threads are slower to create and manage.
If a thread performs a blocking system called, the kernel can schedule another thread in
the application.
In multi processor environment, the kernel can schedule threads on different processors.

Scheduling Criteria.[1.9]
CPU utilization
ü keep the CPU as busy as possible
ü In real-time 0 to 100 % CPU utilization possible.
ü 40% (lightly loaded system) to 90% ( heavily loaded system) CPU utilization
Throughput
ü The number of processes completed per time unit.
ü For long Process – this rate may be 1 process per hour.
ü For short process - might be process per hour
Turnaround time.
ü How long it takes to execute that processes.
ü The Interval from the time of submission of a process to the time of completion is the
turnaround time.
Waiting time .
ü Amount of time a process has been waiting in the ready queue
Response time
ü Amount of time it takes from when a request was submitted until the first response is
produced, not output (for time-sharing environment)
1. What are the different types of schedulers? Briefly explain them
There are three types.
i. Long term scheduler
ii. Short term scheduler
iii. Medium term scheduler
Long-term scheduler (or job scheduler)
ü Selects which processes should be brought into the ready queue.
ü Job scheduler selects processes from the queue and loads them into memory for
execution.
ü Long term scheduler should select a good process mix of processes to better the system
performance such as I/O-bound process and CPU-bound process. I/O-bound process -
spends more time doing I/O than computations, many short CPU bursts.CPU-bound
process - spends more time doing computations; few very long CPU bursts.
ü The long-term scheduler controls the degree of multiprogramming
ii. Short-term scheduler (or CPU scheduler)
ü Selects which process should be executed next and allocates CPU.
ü Short-term scheduler is invoked very frequently (once every 100 milliseconds)
ü must be fast or else waste too much time scheduling and not executing
ü Short time scheduler is faster then long term scheduler.
iii. Medium term Scheduler
ü Time sharing OSs may introduce a medium term scheduler
ü Removes processes from memory (and thus CPU contention) to reduce the degree of
multiprogramming – swapping
ü Swapping may be needed to improve the process mix or to free up memory if it has
become overcommitted

Scheduling Criteria.[1.9]
CPU utilization
ü keep the CPU as busy as possible
ü In real-time 0 to 100 % CPU utilization possible.
ü 40% (lightly loaded system) to 90% ( heavily loaded system) CPU utilization
Throughput
ü The number of processes completed per time unit.
ü For long Process – this rate may be 1 process per hour.
ü For short process - might be process per hour
Turnaround time.
ü How long it takes to execute that processes.
ü The Interval from the time of submission of a process to the time of completion is the
turnaround time.
Waiting time .
ü Amount of time a process has been waiting in the ready queue
Response time
ü Amount of time it takes from when a request was submitted until the first response is
produced, not output (for time-sharing environment)

S-ar putea să vă placă și