...

Wednesday, February 23, 2011

CAOS 09

This article will be focused on the Transition State Diagram. It is depicted below:

A process is a program in execution. This state transition diagram depicts the various states a process can transit in operation.

A process can be in 5 states:
New - The process is being created
Running - Instructions are being executed
Waiting - The process is waiting for some event to occur (I/O or reception of signal)
Ready - The process is waiting to be assigned to a processor
Terminated - The process has finished execution

Only one of these processes can be in the running state at one time.

The processes that enter a system are put in a job queue. This is a pool of all processes in a system. The long-term scheduler (or job scheduler) admits the job into the Ready Queue from the Job Queue. The long-term scheduler is rarely called.

The long-term scheduler controls the degree of multiprogramming - The number of processes in the Ready Queue.

The Ready Queue consists of all the processes that reside in the main memory. The short-term scheduler (or CPU scheduler) dispatches the processes with a Scheduling Algorithm for the CPU to process. The CPU scheduler also interrupts a running process into the Ready Queue for another process. The Ready Queue is called very frequently.

A process goes through an alternation of CPU bursts (doing processing) and I/O bursts (doing I/O).

An I/O bound process is a process that spends most of its life in I/O bursts. If the system is mostly comprised of I/O bound processes, than there would be a lot of processes in Device Queues and less processes in the Ready Queue (waiting for the CPU)

On the other hand, if there are more CPU bound processes, then there would be more processes in the Ready Queue and less in the Device Queues.

Each process is represented by a PCB (Process Control Block) which contains information associated with the specific process.

Although the long-term scheduler controls the degree of multiprogramming, its control is only one way: It can only increase it. The medium-term scheduler controls the degree of multiprogramming by temporarily removing it from the Ready Queue and putting it and its PCB in a secondary storage, thus reducing the Degree of Multiprogramming.

As processes switch in and out of the Running state, their PCBs are saved and reloaded as shown in this diagram:


PCBs store the context of the process. The switching is pure overhead as the system does no useful work while switching.

For a context switch to take place, the kernel saves the context of the old process in its PCB, then reloads the saved context of a new process scheduled to run. This process is repeated to switch the old process back.

4 comments :

  1. It's in reality a great and helpful piece of information. I am satisfied that you just shared this helpful info with us. Please keep us up to date like this. Thanks for sharing.

    My blog :: Michael Kors Outlet

    ReplyDelete
  2. This excellent website definitely has all of the info I needed about this subject and didn't know who to ask.

    Also visit my web-site ... Low Nike Blazers

    ReplyDelete
  3. I do believe all of the ideas you've offered in your post. They're really convincing and can
    certainly work. Still, the posts are very brief for newbies.
    May you please extend them a little from subsequent time?
    Thanks for the post.

    My homepage ... mulberry Outlet uk [http://www.whatsot.com/]

    ReplyDelete
  4. Quality articles is the important to attract the visitors
    to pay a visit the site, that's what this website is providing.

    my webpage; Air Max Femme

    ReplyDelete

<