Study/CS

[운영체제] 프로세스 2, 3

Reese 2023. 5. 15. 21:09

Thread

  • Thread의 구성
    • program counter
    • register set
    • stack space
  • Thread가 동료 thread와 공유하는 부분(=task)
    • code section
    • data section
    • OS resources
  • 전통적인 개념의 heavyweight process 는 하나의 thread를 가지고 있는 task로 볼 수 있다.

  • 다중 스레드로 구성된 태스크 구조에서는 하나의 서버 스레드가 blocked (waiting) 상태인 동안에도 동일한 태스크 내의 다른 스레드가 실행되어 빠른 처리를 할 수 있다.
  • 동일한 일을 수행하는 다중 스레드가 협력하여 높은 처리율(throughput)과 성능 향상을 얻을 수 있다.
  • 스레드를 사용하면 병렬성을 높일 수 있다.

Benefits of Threads

  • Responsiveness
  • Resource Sharing
  • Economy
    • creating & CPU swiching thread
    • Solaris의 경우 위 위 두 가지 overhead가 각각 30배, 5배
  • Utillization of MP Architectures

Implementation of Threads

  • Some are supported by kernelKernel Threads
    • Windows 95/98/NT
    • Solaris
    • Digital UNIX, Mach
  • Others are supported by libraryUser Threads
    • POSIX Pthreads
    • Mach C-threads
    • Solaris threads
  • Some are real-time threads