ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > zstu-(2021-2022)-1 > 2019529628011_ENOCH KWATEH DONGBO >
2019529628011_ENOCH KWATEH DONGBO_Homework_2 Version 0
👤 Author: by enochdongbogmailcom 2021-09-15 06:11:15
Question

Describe their relation and difference for process and program. Why the status of process is divided into five states, not other numbers, such as 4, 7? describe the contents of process control block.

 

Answer:

The relation and difference for process and program is that; process is a program in execution. It is more than the program code, which is sometimes known as the text section. It also includes the current activity, as represented by the value of the program counter and the contents of the processor's registers. A process generally also includes the process stack, which contains temporary data (such as function parameters, return addresses, and local variables), and a data section, which contains global variables. A process may also include a heap, which is memory that is dynamically allocated during process run time. Moreover, a program by itself is not a process; a program is a passive entity, such as a file containing a list of instructions stored on disk (often called an executable file), whereas a process is an active entity, with a program counter specifying the next instruction to execute and a set of associated resources. A program becomes a process when an executable file is loaded into memory.

 

The status of process is divided into five states and not other numbers such as 4, and 7 because; as a process executes, it changes state. The state of a process is defined in part by the current activity of that process.

 

Process Control Block
Each process is represented in the operating system by a process control block (PCB)-also called a task control block. In a brief descr iption, the PCB simply serves as the repository for any information that may vary from process to process. Contents within the PCB include Process state, Program counter, CPU registers, CPU-scheduling information, Memory-management information, Accounting information, and I/O status information

Please login to reply. Login

xamraev2020mailru • 2021-12-08 11:27:01
Process is an executing part of a program whereas a program is a group of ordered operations to achieve a programming goal.

The process has a shorter and minimal lifespan whereas program has a longer lifespan.

Process contains many resources like a memory address, disk, printer while Program needs memory space on the disk to store all instructions.

When we distinguish between process and program, Process is a dynamic or active entity whereas Program is a passive or static entity.

To differentiate program and process, Process has considerable overhead whereas Program has no significant overhead cost.

A program, I am referring to any program written in any programming language. It could be a Java program which has only one method to do the multiplication, and a main method executes that multiplication method. Or it could be a program in Python does the same thing. Or it could be an application program such as an email client, a web browser, or a chat application, or an online game client.

Five-State Process Model is an extension of the two state model. The two-stage model is efficient if all the processes in the Not-running state are ready for execution but this may not be true. Some processes in the Not-running state might be waiting for some event or I/O operation. Thus, the dispatcher cannot simply select the process from the front of the queue. The dispatcher would have to scan the queue to search for the process to execute. It degrades performance. PostVer 0

Please login to reply. Login

Reversion History

Loading...
No reversions found.