As I studied Docker, I needed to understand the concept of the process in order to understand how Docker Engine works, so I investigated the details of the process.
A container exists as a process on the host OS, like Docker Daemon, which manages the creation, start, and deletion of containers. Since it is a process on the host OS, resources such as CPU, memory, and network can be accessed via the host OS in the same way as a standalone application on other host OS, and when the process ends, it is retained in memory. I understand that it is natural that the operation data on the container that is being used will also disappear.
■ What is a process? A process is a resource execution management unit such as a CPU on the OS that loads the binary code stored in the HDD etc. into the memory by the scheduler of the OS and makes the CPU executable.
■ Differences between processes and threads 1 program ⇒ 1 process Multiple threads can be run in one process (single thread and multithread) Thread executes instructions in process 1 thread uses 1 CPU core One CPU can contain multiple CPU cores.
Memory space is allocated on a process-by-process basis Share the memory space of the process to which the thread belongs
■ Difference between single process and multi-process Single process: Thread ①: Start cooking ⇒ Cook rice ⇒ Stew curry ⇒ Serve on a plate ⇒ Finish cooking Multi-process: Thread ①: Start cooking ⇒ Start process ② ⇒ Cook rice ⇒ Process ② Wait for completion ⇒ Finish cooking Thread ②: Cook curry
Recommended Posts