Metadata file 1 Another metadata file A Program Applicatio

Meta-data file 1:

Another meta-data file:

• A - Program Application, used with start and end
• P - Process, used with run
• I - used with Input operation descriptors such as hard drive, keyboard, mouse
• O - used with Output operation descriptors such as hard drive, monitor, speaker
• M - Memory, used with block, allocate

I need to set the state of the process in my program. I think P(run) means the process is in \"running\" state, and I(keyboard) or O(monitor) means the process is in \"waiting\" state.

A(start) means that I need to set the process to \"ready\"? What state should M(allocate) and M(block) be in? \"run\", \"ready\", or \"waiting\"? Why?

exit admitted interrupt terminated new ready running scheduler dispatch lo or event completion I/O or event wait waiting

Solution

Hi,

Let\'s understand the whole process with example and then your question.

When we write a program and save it with some name and extension, it is being stored at the hard disk drive(secondary memory). While during execution the OS has the job of handling the program which is then termed as a \'process\'. When the program is loaded in memory(Main Memory or RAM) the process is divided with 4 sections, stack area, heap area, data, code. Now, the OS keeps the track of each and every incoming processes, so a datastructure is maintained by the OS named as PCB(process controlled block) which contains all the attributes related to every processes.

As the importance of multiprogramming increased, which resulted in efficient use of the CPU. Hence, the job of OS to provide the CPU for execution of each incoming processes efficiently. For this there are some scheduling algorithms that decides the allocation of CPU to the processes accordingly.

The process scheduling diagram is the systematic representation of how a process traverses through all the states of its execution. At \"new\" the process is in its program state present in the Hard Disk, its then fetched from secondary memory to the Primary memory(done by the Long Term Scheduler),in the \"Ready\" state a ready queue is maintained where all the processes are queued and ready for execution accordingly to the priorty or arrival time depending on the condition and algorithm. Some times the process requires for some input/output operations for which its then suspended during its execution or sent to the waiting state(maintained by the Medium Term Scheduler), generally if there is no space available its kept temporarily in the secondary memory for I/O completion. After that it again gets back to the ready state and then(short term scheduler) then allocates the CPU for its execution and at last the process terminates.

Explanation of your question: M(allocate) must be in the \"ready state\" as when processes are maintained in the ready queue by the (long term scheduler) every process are allocated with separate memory for stack area, heap area, data, code area(text). And this allocation is being logged in a datastructure (PCB) by the OS itself.

M(block) must be in the \"waiting state\" as due to some priorities issue or I/O oprations the process is suspended by the Medium term Scheduler temporarily. And the \"I(keyboard)\" means that there is an input interrupt from the keyboard, similarly \"O(monitor)\" means there is an output interrupt from the monitor, where both of these belongs to the waiting state. And P(run) refers that the process is in its execution state, after completion it terminates and gets swapped out from the Primary memory.

Hope it made your doubt clear. If any further query feel free to ask.

ThankYou for using Chegg!!!

Meta-data file 1: Another meta-data file: • A - Program Application, used with start and end • P - Process, used with run • I - used with Input operation descri

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site