A process has a self-contained execution environment. A process generally has a complete, private set of basic run-time resources; in particular, each process has its own memory space.html
一個進程,擁有一個獨用的的執行環境。一個進程一般包含一組完整的,私有的運行時資源。特別的,每一個進程擁有本身的內存空間。java
進程一般被看作一個程序或應用的代名詞。其實,用戶看到的單個應用,事實上多是一組協做的進程。程序員
爲了促進進程間的通訊,大多數操做系統支持 Inter Process Communication (IPC) resources, 例如 pipes, sockets。IPC 不只用來在同一個系統上的進程間的通訊,也能夠用在不一樣系統上進程間通訊oracle
Threads are sometimes called lightweight processes. Both processes and threads provide an execution environment, but creating a new thread requires fewer resources than creating a new process.socket
線程,有時候稱之爲「輕量級進程」。線程和進程都提供單獨的執行環境,但新建一個線程所需的資源要少於
新建一個進程所需的資源。ide
線程必定包含在進程中。每一個進程至少有一個線程。 ui
線程能夠共享進程的資源,包括內存和打開的文件。這麼作是能夠更高效,但會存在一些問題.spa
在程序員的眼中,每個程序都是從一個主線程(main thread)開始,在這個線程上,能夠建立更多的線程操作系統
線程必定包含在進程中。每一個進程至少有一個線程。線程
進程一般有一組完整的,私有的運行時資源。線程能夠共享進程的資源。
進程間經過 IPC 進行通訊。線程間經過共享資源進行通訊。