- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有人问我这个面试问题。在认为流程是线程的超集之后,我回答说线程是流程,但面试官不同意。这很令人困惑,我无法找到任何明确的答案。
最佳答案
进程是应用程序的执行实例。
线程是进程内的执行路径。
另外,a process can contain multiple threads
。
1。
It’s important to note that a thread can do anything a process can do. But since a process can consist of multiple threads, a thread could be considered a ‘lightweight’ process. Thus, the essential difference between a thread and a process is the work that each one is used to accomplish. Threads are used for small tasks, whereas processes are used for more ‘heavyweight’ tasks – basically the execution of applications.
Another difference between a thread and a process is that threads within the same process share the same address space, whereas different processes do not. This allows threads to read from and write to the same data structures and variables, and also facilitates communication between threads. Communication between processes – also known as IPC, or inter-process communication – is quite difficult and resource-intensive.
关于multithreading - 进程是线程还是线程是进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24445699/
我是一名优秀的程序员,十分优秀!