
Jasmine Grover Content Strategy Manager
Content Strategy Manager
Process in an operating system refers to an ongoing program that serves as the fundamental unit of computing. Despite being quite similar, the process is not exactly the same as programming for computers. In this article, the concept of Process in Operating Systems is covered according to the GATE Syllabus for (Computer Science Engineering) CSE.
- A process is an "operational" entity in contrast to the program, which is sometimes thought of as some sort of "independent" entity.
- The attributes that the process holds include hardware status, RAM, CPU, and other variables.
Table of Content |
Key Terms: Operating System, Process, Scheduling, Operation, Software, Identification, Memory, Multiprocessing, Multiprogramming
Process in an Operating System
[Click Here for Sample Questions]
In essence, the software is being run by processes. Any process that is carried out must be done in a precise order. A process is an object that aids in describing the basic tasks unit that must be carried out in any system.
To put it another way, computer programs are developed as text files, and after running them, they transform into processes that carry out all of the tasks listed in the program.
After a program is loaded and converted into a process in memory, it can be split into four key components:
- Stack
- Heap
- Text
- Data
Components of a Process
[Click Here for Sample Questions]
The following are four components of a process:
1. Stack
The process stack holds temporary data, including the return address, method or function parameters, and local variables.
2. Heap
This is the RAM that a process is periodically allotted while it is running.
3. Text
This includes both the structure of the processor's caches and the most recent activity indicated by the program counter's number.
4. Data
Both static and global parameters are covered in this component.
Process life cycle
[Click Here for Sample Questions]
A process has several states while it operates. The initials of these states vary across various operating systems and are not specified. A process can typically be found within just one of the five phases indicated below at any one point in time.
1. Start
This is the state in which a process is when it initially begins or generates.
2. Ready
The process is currently awaiting a processor assignment. Ready processes are awaiting the operating system's assignment of a processor so they can begin to function. Whether the process is already running or has just started, the scheduler may interrupt it to give the CPU a different process.
3. Running
The processor starts executing the process commands as soon as the OS schedule allocates it to a processor, setting the status of the process to executing.
4. Waiting
A process approaches the state of waiting when it requires waiting to access a resource, like input from the user or for an attachment to become visible.
5. Finished or Exit
Once the process completes its execution or is terminated by the operating system, it transitions to the finished state, where it awaits removal from the main memory.
Process Control Block
[Click Here for Sample Questions]
An operating system uses a Process Control Block to assist in the development, organization, and termination of processes.
- The Operating System's Process Control Block (PCB) assists in controlling the way processes behave.
- There is a Process Control Block associated with each OS process.
- A PCB keeps records of processes by logging information on many factors, such as their state, I/O status, and CPU planning.
Below are the components that form a process control block are:
1. Process ID
It serves as a symbol of recognition for the process. This is excellent for figuring out the procedure. It is also quite helpful for figuring out the process.
2. Process State
Whether the procedure is currently ready, waiting, running, or in another state.
3. Program Counter
The program counter (PC), a vital register of the computer processor, stores the instruction pointer (IP) address of the next command to be executed from memory. A digital counter is necessary for tracking the task's progress and determining how quickly it should be completed.
A program counter may also be referred to as a command counter, command pointer, instructions concentrating on the register, or sequence control register.
4. CPU Registers
The information in the processor registers is stored here whenever a process is in a state of operation. CPU registers can be divided into a wide variety of types, including accumulators, index and general-purpose registers, instruction registers, and condition code variables.
5. CPU Scheduling Information
Setting up a running procedure is required. When it switches from ready to go running, according to this routine. CPU scheduling information also contains a number of other scheduling factors, such as process priority, scheduling queue pointers (which show the execution order), and so on.
6. Accounting and Business Information
Details on CPU usage, the quantity of time a process spends running in real-time, the total number of activities or processes, and other statistics are all included in the State of Business Addressing and Information.
7. Memory Management Information
The page, sector tables, and base and limit register values are all covered in the memory management information part. It is dependent on the operating system's memory management system.
8. Input Output Status Information
This part of the website is dedicated to providing information about input and output changes, as well as other input and output-related issues.
Also Read:
Related Articles | ||
---|---|---|
GATE 2024 books | GATE CSC 2024 Exam Pattern | GATE question paper |
GATE score validity | GATE online coaching | GATE mock test |
Different process state
[Click Here for Sample Questions]
The following states are possible for the operating system's processes:
- NEW: The development of the procedure.
- READY: The state of waiting for a task to be allocated to a particular processor.
- RUNNING: The orders are being carried out.
- WAITING: The act of a process awaiting an impending event (such as an I/O completion, a signal receiving, etc.).
- TERMINATED: A process has concluded when it is TERMINATED.
Program
[Click Here for Sample Questions]
A program is a collection of directions that are carried out when a specific task is permitted to be finished. Typically, programming languages like C, C++, Python, Java, R, C# (C sharp), etc. are used to write the programs.
A collection of commands known as a computer program allows a computer to carry out specific tasks.
Process vs. Programme
[Click Here for Sample Questions]
Below is the table stating the differences between Process and Programme:
Sr. no. | Process | Program |
---|---|---|
1. | A process is an operating piece of a computer program or software. Any process has to be followed in a specific order. A process is a thing that aids in defining the fundamental operation of the unit that must be carried out in any system. | A program is a series of directions that are carried out when a particular assignment is permitted to be finished. |
2. | Processes are naturally flexible. | Programs are naturally inflexible. |
3. | The process is engaged by Nature | The program has a reactive nature. |
4. | The process is generated during operation and promptly loaded into the main memory. | Program is already present in the primary memory and secondary memory. |
5. | The Process Control Block is the process's own internal control mechanism. | The program has no control mechanism. It is only called when necessary, and when called, it runs the entire program. |
6. | Processes occasionally alter on their own. | The program itself cannot be changed. Programmer changes are required. |
7. | Additional data are required for a process in addition to the program data required to manage and implement. | The program is essentially split into two sections. The first is the code part, and the second is the data part. |
8. | Processes have high resource requirements; prior to their entry or existence in the operating system, they need resources such as memory addresses, a central processing unit, and input, or output. | A program doesn't require any more resources; it only needs memory space for storing its commands. |
Process Scheduling
[Click Here for Sample Questions]
The operating system selects which process to launch first if there are multiple more than one runnable process; this process is referred to as process scheduling.
A program called a scheduler makes decisions based on a scheduling algorithm. A good scheduling algorithm should have the qualities listed below:
- Reaction time for users should be kept to an absolute minimum.
- The number of jobs processed as a whole per hour should be as high as feasible, which implies that a smart scheduling system should deliver the largest throughput.
- Utilize the CPU to its fullest capacity.
- Equal amounts of CPU time ought to be allotted to each process.
Also Read:
Related Articles | ||
---|---|---|
Pipeline Hazards | Primary Memory | Relational Operators in C |
Ring Topology | Recursive Function in C | Secondary Memory |
PnP Full Form | Transitive Dependency in DBMS | Tree Topology |
Things to Remember
- The difference between a process and a program is that a process is an "operational" entity, whereas a program is sometimes viewed as an "independent" entity.
- An algorithm is a component of a computer program that completes a particular assignment.
- A program is a set of instructions that are followed when a certain task is approved for completion.
- The different states of the process are start, ready, running, waiting, and terminated.
- The components of the process are heap, text, data, and stack.
- The operating system controls the data structure known as the process control block, which is a component of every process.
- The Process Control Block (PCB) is represented by an integer PID or process ID.
Sample Questions
Ques. What do you mean by process scheduler? What qualities should a good process scheduler have? (3 Marks)
Ans. Scheduling governs the order in which tasks are performed and is managed by a set of guidelines and procedures. The system software includes the scheduling program known as the scheduler, and the algorithm it utilizes is called the scheduling algorithm.
Several factors or traits that help in creating an effective scheduler include:
- CPU Use – To ensure maximum CPU utilization, it is essential to design an efficient scheduling technique. The CPU should be utilized effectively.
- Throughput - The volume of work finished in a unit of time is referred to as throughput. In simpler terms, throughput is the relationship between the number of finished tasks per unit of time and the executed procedures. To optimize the number of jobs processed per time unit, it is necessary to utilize the scheduling method.
- Response time - In technical contexts, response time signifies the latency to start answering a request. An interactive user's reaction time should be as quick as possible for a scheduler.
- Waiting time - When multiple jobs are fighting for resources in a multiprogramming system, this period of time is known as the waiting period. Efforts should be made to minimize the waiting time.
Ques. What is SRT scheduling, or the Shortest Remaining Time? (2 Marks)
Ans. Shortest Remaining Time, sometimes known as SRT, is an anticipatory planning method. In SRT, all processes including newly arrived ones are scheduled to run after the process with the least remaining runtime. In SRT, a newly created process with a shorter expected run time may replace a running process. It manages sporadic cancellations and keeps track of the operating process's elapsed service time.
Ques. What benefits can multiprogramming include? (3 Marks)
Ans. Multiprogramming has various benefits.
- Multiprogramming organizes a lot of tasks such that the CPU always has one to complete, increasing CPU utilization.
- Higher throughput is the total number of programs that are performed in a given amount of time. Throughput is higher in multiprogramming because the CPU does not wait for I/O for the program it is now running.
- Shorter Turnaround Time Multiprogramming significantly reduces the turnaround time for small jobs.
- Multiprogramming allows for better main memory utilization because multiple programs can run simultaneously. Memory is thus used to its full potential.
- Multiprogramming results in a better degree of resource utilization since numerous programs are actively contending for resources.
- Multiple users are supported by multiprogramming.
Ques. How can buffering boost a computer system's performance? (3 Marks)
Ans. If the speed of the CPU and the I/O devices are roughly equal, the buffering aids in having them both operate at maximum speed so that neither device ever has a chance to become idle.
The C.P.U. is typically significantly quicker than an input device. In this situation, the Central Processing Unit (CPU) consistently encounters an empty input buffer and eagerly awaits the input device to read a record into the buffer. When it comes to output, the C.P.U. keeps running at maximum speed until the output buffer is filled, at which point it begins to wait.
As a result, workloads that balance computational effort and I/O operations benefit from buffering. Other situations might result in buffering scheme failure.
Ques. What are the benefits of a parallel or multiprocessing system? (3 Marks)
Ans. The usage of multiple processors in close coordination is supported by multiprocessing operating systems or parallel systems.
Here are several advantages of a multiprocessing system:
- Increased Throughput: The multiplication of processors allows for accomplishing more tasks within a specified timeframe, leading to increased productivity.
- Saving money: Parallel systems exhibit resource sharing of peripherals, buses, and memory. Hence, choosing multiprocessor systems is a cost-effective decision when compared to deploying multiple single systems. Additionally, it is less expensive to store data on a single disc that is shared by all processors when several programs need to access the same data than it is to use multiple copies of the same data.
- Increased dependability: This system has increased dependability since the workload is spread among numerous processors. Even though the system may operate more slowly if one of the processors breaks, it will still function properly.
Ques. What difficulties might a user encounter when using a computer system without an operating system? (2 Marks)
Ans. The computer system's operating system is a necessary component, to be precise. Computer hardware is nothing more than an idle electronic device without an operating system, making it difficult for the user to execute programs.
Due to the fact that only machine language is understood by computer hardware. Every program must be written in machine language, which is tough to do.
Therefore, it would be very challenging to run user programmes or address user issues without an operating system.
Ques. Write a short note on time slicing. (3 Marks)
Ans. In time-sharing systems, time slicing is a scheduling method or process. A different name for it is round-robin scheduling. Giving all processes an equal chance to consume CPU is the goal of Round Robin scheduling or time-slicing scheduling. Slices of CPU time are broken up and assigned to prepared processes in this sort of scheduling.
- One-time quantum may be used to complete brief processes. Numerous quanta may be needed for lengthy processes.
- The effectiveness of the time-slicing policy is heavily influenced by both the size and duration of the time quantum.
- The Round Robin policy turns into an FCFS policy when the time quantum is quite large.
- Insufficient quantum size leads to excessive context/process transitions, causing a decline in CPU performance. Therefore, the selection of time quanta is a crucial design choice.
- A certain amount of time is needed to save and load registers, update various tables and lists, etc. during the process-switching operation.
Ques. What is pseudo-parallelism? Describe the process paradigm that helps people cope with parallelism more effectively. (4 Marks)
Ans. All current computers are capable of performing multiple tasks at once. A computer, for instance, may be executing a user program while reading from a disc and printing to a printer. The CPU alternates between programs in a multiprogramming system, running each one for a brief period of time.
- Despite the fact that the CPU only ever has one program executing at once. Because of the high CPU speed, many programs can run simultaneously.
- It provides the user with the impression that numerous processes are running concurrently.
- Pseudo parallelism is the phrase for this quick switching of the CPU between programs, which creates the appearance of parallelism.
- The creators of operating systems have developed a process model to make dealing with parallelism easier because it is quite challenging to keep track of numerous, concurrent tasks.
The process model
All of the computer's software that can be run, including the operating system, is arranged into a series of processes in the process model. A process is just an active program that contains the register, counter, and variable values at the time of execution.
It is assumed that each process has its own virtual CPU. The actual CPU alternates between different processes. It is convenient/easier to imagine a group/number of processes operating in (pseudo) parallel in order to track CPU changes across programs. In actuality, multiprogramming is what is happening with the quick switching.
Ques. Describe the allocation algorithms shown below. (5 Marks)
(a) First Fit
(b) Best fit
(c) Worst fit
(d) Buddy’s system
(e) Next Fit
Ans. First fit
The first fit strategy assigns the first available partition or hole that is large enough to accommodate the process. The first eligible free division is where it ends.
Best fit
The best-fit strategy involves assigning the smallest available partition that meets the demands of the requesting process. This algorithm looks through the whole list of available partitions first, then takes into account the smallest hole that is suitable. It next tries to locate a hole that is close to the required process size.
Worst fit
The greatest free section should be found using the poorest fit approach so that the remaining portion will be large enough to be useful. The opposite is true for the ideal fit strategy.
Buddy’s system
Sizes of free blocks in the buddy system are expressed as integral powers of 2, such as 2, 4, 8, 16, etc. up to the size of the memory. A free block from the available list of free blocks of size 2k is allocated when a free block of size 2k is requested. If a free block of size 2k is not available, the request is satisfied by splitting the block of size 2k+1 into two pieces known as friends.
Next fit
A modified version of the first fit is the next fit. Finding a free partition is the first step in the process. The next time it is called, the search resumes where it left off rather than from the beginning.
Ques. When does a page fault take place? (2 Marks)
Ans. If a page requested for execution in the demand paging memory management technique does not exist in the main memory, a page fault occurs. A free page frame is identified and allocated in the main memory in order to load the requested page there. If no page frame is available, the memory manager must free a frame by moving its contents to secondary storage in order to make space for the needed page. Numerous plans or techniques are employed to change pages.
For Latest Updates on Upcoming Board Exams, Click Here: https://t.me/class_10_12_board_updates
Check-Out:
Comments