博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
thread and process
阅读量:4677 次
发布时间:2019-06-09

本文共 1493 字,大约阅读时间需要 4 分钟。

process是进程的意思,它代表程序的一次运行,而一个进程又是由一个以上的线程组成,thread是线程的意思。

线程是最小的调度单位,进程是最小的内存分配单位。

Both threads and processes are methods of parallelizing an application. However, processes are independent execution units that contain their own state information, use their own address spaces, and only interact with each other via interprocess communication mechanisms (generally managed by the operating system). Applications are typically divided into processes during the design phase, and a master process explicitly spawns sub-processes when it makes sense to logically separate significant application functionality. Processes, in other words, are an architectural construct.

By contrast, a thread is a coding construct that doesn't affect the architecture of an application. A single process might contains multiple threads; all threads within a process share the same state and same memory space, and can communicate with each other directly, because they share the same variables.

Threads typically are spawned for a short-term benefit that is usually visualized as a serial task, but which doesn't have to be performed in a linear manner (such as performing a complex mathematical computation using parallelism, or initializing a large matrix), and then are absorbed when no longer required. The scope of a thread is within a specific code module—which is why we can bolt-on threading without affecting the broader application.

转载于:https://www.cnblogs.com/reynold-lei/archive/2013/03/28/2985858.html

你可能感兴趣的文章
APP自动化测试
查看>>
HTML中让表单input等文本框为只读不可编辑的方法
查看>>
nodejs做中间层,向后端取数据
查看>>
IntelliJ IDEA 2017 MySQL5 绿色版 Spring 4 Mybatis 3 配置步骤详解(二)
查看>>
(转)Java DecimalFormat 用法(数字格式化)
查看>>
hiho_100_八数码
查看>>
Eclipse序列号生成代码
查看>>
JVM
查看>>
设计模式记录
查看>>
SPF,DSPF,RDPF,SPEF and SBPF.
查看>>
JS学习文章
查看>>
window系统服务器,远程连接mysql数据库。
查看>>
CAS总结之Ticket篇
查看>>
Python2.7升级至Python3.6
查看>>
框架集
查看>>
003
查看>>
HDU 2923 Einbahnstrasse (最短路,3级)
查看>>
实验吧-密码学-我喜欢培根
查看>>
java set集合与List集合练习
查看>>
简短总结一下C#里跨线程更新UI
查看>>