컴퓨터/운영체제 OS

Multi threading - 쪼꼬미 multi processing

나한나한나한나 2024. 5. 19. 21:25

프로세스

  • state들로 구성된 context
  • 그 context 안에서 수행되는 execution stream
    • execution stream을 다른 말로 하면 thread of control, 또는 thread
  • Unit of resource ownership -> process 또는 task
  • Unit of dispatching -> thread 또는 lightweight process

쓰레드

  • has an execution state (running, ready, blocked)
    • saves thread context when not running
  • has a runtime stack for local variables and some per-thread static memory
  • has access to the memory address space and resource of its process
    • all threads of a process share these
    • when one thread alters a (non-private) memory item, all other threads (of the process) see that
    • a file opened by a thread is available to others

single threading vs multi threading