ⓟrogramming/Programming

Processes VS Threads

뚱땡이 우주인 2018. 1. 23. 11:02

Threads are a part of a process, i.e. a process may contain one or more threads. but thread cannot contain process.


Process

  • contains the program code and its current activity.
  • has a self-contained execution environment.
  • has a complete set of private basic run-time resources; each process has its own memory space
  • To facilitate communication between the processes, most operating system use Inter processes Communication(IPC) resources, such as pipes and sockets.
  • Run in separate memory spaces.

Thread

  • excite even the smallest sequence of programmed instructions that can be manged independently by an operating system.
  • threads are made of and exist within a process
  • lightweight processes
  • Threads can directly communicate with other threads of its process
  • Run in shared memory spaces