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

Scheduling

cheduling is the method by which threads, processes or data flows are given access to system
resources (e.g. processor time, communications bandwidth). the need for a scheduling algorithm
arises from the requirement for most modern systems to perform multitasking (executing more
than one process at a time) and multiplexing (transmit multiple data streams simultaneously
across a single physical channel).
Types :
Long-term scheduling
The long-term, or admission scheduler, decides which jobs or processes are to be admitted to
the ready queue (in the Main Memory); that is, when an attempt is made to execute a program,
its admission to the set of currently executing processes is either authorized or delayed by the
long-term scheduler . Thus, this scheduler dictates what processes are to run on a system, and
the degree of concurrency to be supported at any one time whether a high or low amount of
processes are to be executed concurrently, and how the split between I/O intensive and CPU
intensive processes is to be handled. The long term scheduler is responsible for controlling the
degree of multiprogramming
Medium term scheduling[edit]
Scheduler temporarily removes processes from main memory and places them on secondary
memory (such as a disk drive) or vice versa. This is commonly referred to as "swapping out" or
"swapping in" (also incorrectly as "paging out" or "paging in"). The medium-term scheduler may
decide to swap out a process which has not been active for some time, or a process which has a
low priority, or a process which is page faulting frequently, or a process which is taking up a large
amount of memory in order to free up main memory for other processes, swapping the process
back in later when more memory is available, or when the process has been unblocked and is no
longer waiting for a resource.
The short-term scheduler (also known as the CPU scheduler) decides which of the ready, inmemory processes are to be executed (allocated a CPU) after a clock interrupt, an I/O interrupt,
an operating system call or another form of signal. Thus the short-term scheduler makes
scheduling decisions much more frequently than the long-term or mid-term schedulers - a
scheduling decision will at a minimum have to be made after every time slice, and these are very
short. This scheduler can be preemptive, implying that it is capable of forcibly removing
processes from a CPU when it decides to allocate that CPU to another process, or nonpreemptive (also known as "voluntary" or "co-operative"), in which case the scheduler is unable
to "force" processes off the CPU.

Dispatcher[edit]
Another component that is involved in the CPU-scheduling function is the dispatcher. The
dispatcher is the module that gives control of the CPU to the process selected by the short-term
scheduler

Process state
In a multitasking computer system, processes may occupy a variety of states. These distinct
states may not actually be recognized as such by the operating system

ready queue
A ready queue or run queue is used in computer scheduling. Modern computers are capable of
running many different programs or processes at the same time. However, the CPU is only
capable of handling one process at a time. Processes that are ready for the CPU are kept in
a queue for "ready" process ses. Other processes that are waiting for an event to occur, such as
loading information from a hard drive or waiting on an internet connection, are not in the ready
queue. When process changes the state from new to ready, then there is use of long term scheduler.

Suspended state ::
Some of the reasons to suspend a process are...
1.If one process is ready to excecute,but there is no space
in the main memory,then it is suspended.
2.when one process in main memory which was blocked & there
is another process ready to excecute,but waiting in
secondary memory,then the process in main memory is
suspended.
3.when the parent process suspends,then the sub process is
also suspended.

Blocked state
A task is said to be in the Blocked state if it is currently waiting for either a temporal or
external event. For example, if a task calls vTaskDelay() it will block (be placed into the
Blocked state) until the delay period has expired - a temporal event. Tasks can also block
waiting for queue and semaphore events. Tasks in the Blocked state always have a
'timeout' period, after which the task will be unblocked. Blocked tasks are not available
for scheduling.

Waiting Time - The time the process remains in the ready queue

Turnaround time is the interval between the submission of a


job and its completion.
Response time is the interval between submission of a
request, and the first response to that request
Throughput number of processes that complete their execution per time unit
Burst Time is actually time that is required to complete execution of particular task or process

Waiting Time - The time the process remains in the ready queue.

Arrival is the time when the process has arrived the list,
Process Number is used instead of the process name
Arrival time :

Banker's algorithm
The Banker's algorithm is a resource allocation and deadlock avoidance algorithm that
tests for safety by simulating the allocation of predetermined maximum possible amounts
of all resources, and then makes an "s-state" check to test for possible deadlock
conditions for all other pending activities, before deciding whether allocation should be
allowed to continue.

Deadlock avoidance is arranging how resources are


granted at run time so as to avoid deadlock.
Deadlock recovery is generally used when
deadlocks are rare, and the cost of recovery
deadlock recovery::

deadlock recovery by implementing checkpointing and


rollback. Checkpointing is saving enough state of a process
so that the process can be restarted at the point in the

computation where the checkpoint was taken. Autosaving


file edits is a form of checkpointing.
Deadlock prevention is the process of making it logically
impossible for one of the 4 deadlock conditions to hold

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