[OS] Georgia Tech OS 강의 필기
P1L2. Introduction to Operating Systems

P2L1. Processes And Process Management
프로세스란?
- Instance of an executing program
- state of execution: program counter, stack
- parts & temporary holding area: data, register state, occupies state in memory
- may require special hardware: I/O devices

What does a process look like?

What is a Process Control Block (PCB)?

How is a PCB Used?

What is a Context Switch?
cold cache란?
- 메모리에 접근하는 것보다는 processor cache에 접근하는 것이 비용이 훨씬 적다.
- P1이 실행되는 동안 프로세서 캐시에 P1 데이터가 있다가, P2가 실행되면 P1의 데이터는 프로세서 캐시에서 사라진다.
- 결국 P2가 실행되다가 다시 P1이 실행되면 프로세서 캐시에 데이터가 없으므로 메모리에 접근해서 받아와야 한다. 이것이 바로 간접적인 비용이 되는 것

Process Life Cycle


Process Creattion

role of the CPU scheduler

Length of Process


What about I/O?

Inter Process Communication


P2L2. Threads and Concurrency
Introduction



Process vs. Thread
- Thread는 같은 Virtual Address Space 안에 있다.
- 각각의 스레드는 별도의 레지스터, 스택, 프로그램 카운터를 가지고 있다.

Why are threads useful?
- 스레드의 parallelization을 통해 작업 속도를 높일 수 있다.
- 스레드들은 주소공간을 공유하므로 메모리 효율성이 높다.
Benefits of Multithreading: Single CPU
- Thread Context Switch에 걸리는 시간이 어떤 스레드의 idle 시간보다 길면 Context Switch를 한다.
- 스레드의 context switch는 프로세스의 context switch에 비해 비용이 훨씬 적게 들기 때문에 효율적이다.

Concurrency Control & Coordination
- Mutual Exclusion(mutex): exclusive access to only one thread at a time
- Condition Variable: waiting on other threads specific condition before proceeding
Thread Creation

Mutual Exclusion
- Mutex는 lock 여부, owner, blocked threads에 대한 정보를 필요로 한다.
- critical section code block은 오직 하나의 스레드에 의해서만 실행될 수 있다.

Condition Variable

