Processes and Threads
Tags: beginners, productivity, opensource, computerscience
Published: 2023-03-16 17:59:23

{% embed https://youtu.be/OrM7nZcxXZU %}

---

**Calzy Akmal-2101569**

Process Management is a series of activities performed by a computer system to manage, control, and optimize the performance of processes running within the system. Stallings and Tanenbaum (2020) state that process management in an operating system requires proper strategies in resource allocation and memory management to ensure efficient system operation. Process management encompasses several tasks, such as creating and terminating processes, scheduling and allocating computer resources like the CPU, memory, and I/O devices, inter-process communication, and activity synchronization, memory management, and process supervision to prevent system conflicts and failures.

In creating a program using a high-level programming language, a translation process is needed as the computer operates using binary systems consisting of two numbers, 0 and 1. Hence, a compiler is used to translate the high-level language into binary language that can be processed by the computer so that the program written by humans can be understood and executed by the computer. 
The role of process management is to optimize the set of code that has been translated by the compiler to make the memory needed by the computer to run the program more orderly and efficient. Additionally, process management also allocates computer resources required to run the program while supervising any execution failures.

The allocation process is performed by the operating system, which automatically divides the necessary memory to run the program so that the program can run optimally and minimize any issues that may arise. The operating system executes the executable created by the compiler by inserting the program's data into memory and allocating the resources needed to run the program. 

When the program is running, the status changes from being just a program to a process. According to Tanenbaum and Bos (2015), a process is a program being executed by the operating system, including the data related to the execution such as memory addresses, status, and resource management. In the past, computers could only run one program being executed as the machine's capability was insufficient to run a multi-process system. With technological advancements, computers can now run multiple processes simultaneously, with optimized memory and better performance.

Within a process, there are "threads" that function as the basic execution unit in a program or process. According to Silberschatz, Galvin, and Gagne (2013), a thread can be thought of as a sub-component of a process that can be independently scheduled by the operating system. Threads improve system efficiency and responsiveness by allowing multiple tasks to be executed in parallel within a process. In this regard, threads allow the operating system to effectively utilize processing power.

Process management is crucial in ensuring the efficient execution of multiple processes and threads in an operating system. It involves the allocation of resources, scheduling, memory management, and process communication. A significant challenge in process management is avoiding conflicts among processes, particularly in cases where multiple processes are competing for the same resources. 

---

## Operating System Exercise


**1. Managing Service**

> SSHD ![SSHD](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cbx1iqfxjy0o8ktnxppb.png)

> SSHD Stop![SSHD Stop](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ewum5kns9s83aw4k8qgz.png)

> SSHD Start![SSHD Start](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xcx4qs5vvcnzh23sbkwx.png)

> SSHD Restart![SSHD Restart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/675yq569jpkgwo90cbvw.png)

**2. Running Init**

> SSH Status![Status](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59bvt33yeki74x2ro0hs.png)

**3. TOP**

> ![TOP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nbuwymc4t47659j3pfhi.png)

---


## **References:**

Silberschatz, A., Galvin, P. B., & Gagne, G. (2013). Operating 
system concepts (9th ed.). John Wiley & Sons.
Stallings, W., & Tanenbaum, A. S. (2020). Operating Systems: 
Internals and Design Principles. Pearson.
Tanenbaum, A. S., & Bos, H. (2015). Modern operating systems (4th 
ed.). Pearson Education.