Professional Documents
Culture Documents
Assigment 2
Assigment 2
A. Explain what a process is and why process management is essential in operating system.
Process management involves various tasks like creation, scheduling, termination of processes, and a dead lock. Process is a program that is
under execution, which is an important part of modern-day operating systems. The OS must allocate resources that enable processes to share
and exchange information. It also protects the resources of each process from other methods and allows synchronization among processes.
It is the job of OS to manage all the running processes of the system. It handles operations by performing tasks like process scheduling and
such as resource allocation.
System Initialization
A process may be created by another process using fork(). The creating process is called the parent process and the created process is the child process. A
child process can have only one parent but a parent process may have many children. Both the parent and child processes have the same memory image,
open files and environment strings. However, they have distinct address spaces.
Process Termination
Process termination occurs when the process is terminated The exit() system call is used by most operating systems for process termination.
A process may be terminated after its execution is naturally completed. This process leaves the processor and releases all its resources.
A child process may be terminated if its parent process requests for its termination.
A process can be terminated if it tries to use a resource that it is not allowed to. For example - A process can be terminated for trying to write
into a read only file.
If an I/O failure occurs for a process, it can be terminated. For example - If a process requires the printer and it is not working, then the
process will be terminated.
In most cases, if a parent process is terminated then its child processes are also terminated. This is done because the child process cannot
exist without the parent process.
If a process requires more memory than is currently available in the system, then it is terminated because of memory scarcity.
C. Discuss how process are identified and managed by the operating system.
The operating system uses a variety of techniques to manage processes, including scheduling algorithms that determine which process to run
next, process synchronization mechanisms that prevent conflicts between processes, and memory management techniques that allocate and
de-allocate memory to processes as needed.
D. Explain the different states a process can be (e.g., ready, running, blocked).
Ready: It means a process that is prepared to execute when given the opportunity by the OS.
Running: It means a process that is currently being executed. Assuming that there is only a single processor in the below execution process, so
there will be at most one processor at a time that can be running in the state.
Blocked/Waiting: It means that a process cannot continue executing until some event occurs like for example, the completion of an input-
output operation.
E. Describe the concept of process scheduling the algorithms used by operating system by scheduling .
The following major process scheduling queues are maintained by the Operating System:
Running: Whenever a new process is formed, it is immediately put into the operating state of the system.
Not currently running: Processes that are not now executed are queued and will be executed when their turn comes. Each queue entry is a
pointer to a certain process. Linked lists are used to implement queues. The following is how to use a dispatcher. When a process is halted, it
is automatically shifted to the waiting list. The procedure is discarded once it has been completed or failed. In either scenario, the dispatcher
chooses a process to run from the queue.
Types of Schedulers
Schedulers are specialised computer programmes that manage process scheduling in a variety of ways. Their primary responsibility is to
choose which jobs to submit into the system and which processes to run. Click here to learn more on Process Schedulers in Operating System.
There are three types of schedulers:
Long-Term
A job scheduler is another name for it. A long-term scheduler determines which programmes are accepted for processing into the system. It
picks processes from the queue and then loads them into memory so they can be executed. For CPU scheduling, a process loads into memory.
Short-Term
CPU scheduler is another name for it. Its major goal is to improve system performance according to the set of criteria defined. It refers to the
transition from the process’s ready state to the running stage. The CPU scheduler happens to choose a process from those that are ready to
run and then allocates the CPU to it.
Medium-Term
It includes medium-term scheduling. Swapping clears the memory of the processes. The degree of multiprogramming is reduced. The
switched out processes are handled by the medium-term scheduler.
Context Switch
A context switch is a mechanism in the Process Control block that stores and restores the state or context of a CPU so that a process execution
can be resumed from the very same point at a later time. A context switcher makes use of this technique to allow numerous programmes to
share a single CPU. Thus, context switching is one of the most important elements of a multitasking operating system.
The state of the currently running process is recorded in the PCB when the scheduler changes the CPU from one process to another. The state for
the following operation is then loaded from its PCB and used to set the registers, PC, and so on. The second process can then begin its execution.
Because register and memory states must be preserved as well as recovered, context switches can be computationally demanding. Some hardware
systems use multiple sets of processor registers in order to save context switching time. The following information is saved for further use when the
process is switched.
Program counter
Base and limit register value
Scheduling information
Currently used register
I/O State information
Changed state
Accounting information
B. Explain how the operating system handless process in the given scenario.
Client-server is a relationship in which one program, the client, requests a service or resource from another program, the server. The label client-
server was previously used to distinguish distributed computing by PCs from the monolithic, centralized computing model used by mainframe.
Today, computer transactions in which the server fulfills a request made by a client are very common. The client-server model has become one of
the central ideas of network computing. In this context, the client establishes a connection to the server over a LAN or WAN, such as the internet.
Once the server fulfils the client's request, the connection terminates. Because multiple client programs share the services of the same server
program, a special server called a daemon might activate to await client requests.
In the context of scenario planning, optimization refers to the process of finding the best or most efficient solution to a problem or decision-making
situation. It involves considering various scenarios, or future scenarios, and choosing the one that offers the greatest benefit or the least risk.
In the scenario planning process, optimization may involve developing mathematical models or algorithms that help to evaluate different scenarios
and identify the most desirable outcome. This can be done by taking into account a variety of factors such as market conditions, economic trends,
consumer behavior, and company resources. The goal of optimization in scenario planning is to determine the most effective course of action for an
organization to take in order to maximize its chances of success in a rapidly changing and uncertain environment.
Resources:
https://www.guru99.com/process-management-pcb.html#:~:text=Process%20management%20involves%20various%20tasks,to%20share%20and
%20exchange%20information.
https://www.tutorialspoint.com/process-creation-vs-process-termination-in-operating-system#:~:text=A%20process%20may%20be%20terminated,it%20is
%20not%20allowed%20to.
https://datatrained.com/post/process-management-os/#:~:text=The%20operating%20system%20uses%20a,memory%20to%20processes%20as
%20needed.
https://www.geeksforgeeks.org/5-state-process-model-in-operating-system/
https://byjus.com/gate/process-scheduling-in-operating-system-notes/#:~:text=Multiprogramming%20operating%20systems%20rely%20heavily,ready%2C
%20waiting%2C%20or%20running.
https://www.linkedin.com/pulse/strategic-planning-how-use-scenario-optimize-your-rizwan-khan-fcca
https://kissflow.com/workflow/bpm/business-process-management-overview/