Thread

프로세스(heavyweight process) 내부에 CPU 수행 단위가 여러개 존재하는 것

CPU를 수행하는 단위

"A thread (or lightweight process is a basic unit of CPU utilication"

 

[Process 정보를 담고 있는 Process Control Block]

[PCB 내에서의 Thread]

data, code 등 메모리 공유가 가능한 자원은 최대한 공유(공유하는 부분은 Task 라 칭함)하며,

CPU 수행과 관련된 Program Counter, registers, Stack 영역은 별도로 가진다. 

 

Thread 사용시 기대 효과

1) 다중 스레드로 구성된 태스크 구조에서는 하나의 서버 스레드가 blocked(waiting) 상태인 동안에도 동일한 태스크 내의 다른 스레드가 실행(running)되어 빠른 처리 가능.

2) 동일한 일을 수행하는 다중 스레드가 협력하여 높은 처리율(throughput)과 성능을 얻을 수 있다

3) 병렬성을 높일 수 있다(CPU가 여러개인 컴퓨터인 경우)

 

Thread 사용시 장점

- Responsiveness " if one thread is blocked, another thread continues

- Resource Sharing : n threads can share binary code, data, resource of the process

- Economy : creating & CPU switching thread rather than a process (overhead)

- Utilization of MP(Multi Processor) Architectures : each thread may be running in parallel on a different processor

 

Thread 구현 방식

- Kernel Threads (supported by kernel)

- User Threads (supported by library)

- Real-time Threads

 

※ 이화여대 반효경 교수님의 운영체제 강의내용 정리

반응형

+ Recent posts