엔지니어가 되고 싶은 공돌이
04. Process 본문
4. 1. Definition
- Program: 컴퓨터에게 알려주는 순서가 있는 명령어들의 집합.
- Task: Process 1개.
- Job: Process 여러 개가 모여 일을 처리 할 때.
- Process: 컴퓨터에서 실행 중인 Program이자, Scheduling의 기본 단위.
OS가 Process ID를 주고 관리하며,
Process 안에는 CPU context(register), OS Resource(memory), PID 등이 있습니다.
- Process Virtual Memory
4. 2. Process Creation and Termination
- Process Creation
1) Process Hierarchy(Parent-Child Relationship): 1개의 Process가 다른 Process를 만듭니다.
2) Unix에서는 Process Group라고 부르며,
Windows에는 이런 개념이 없지만 Windows도 Process가 다른 Process를 만듭니다.
3) List of Processes는 Unix에서 ps로, Windows에서는 Task Manager로 볼 수 있습니다.
4) System Call인 fork(): Unix, CreateProcess(): Windows 를 호출해 새로운 process를 생성합니다.
5) System이 Initialization되면, PID가 1번인 init process를 부팅시 강제로 하나를 만듭니다. (fork() X)
- Resource Sharing: Parent Process는 Child Process에게 Resource나 Privilege을 전부 또는 일부 상속합니다.
- Process Termination
1) Normal Exit (Voluntary). ex) return 0;
2) Error Exit (Voluntary). ex) return -1;
3) Fatal Exit (Involuntary). ex) segmentation fault, protection fault
4) 또 다른 Process가 다른 Process를 종료시키는 방법(Involuntary).
Child가 충분한 Privilege를 가진다면, Parent을 종료시키고, 본인만 생존할 수 있습니다.
'Computer Science > Operating System' 카테고리의 다른 글
05. Fork, Exec and CreateProcess (0) | 2025.05.17 |
---|---|
03. Interrupt and Exception (2) (0) | 2025.05.13 |
02. Interrupt and Exception (1) (0) | 2025.05.12 |
01. Introduction to Operation System (0) | 2025.05.06 |