3

线程和进程的区别?

 2 years ago
source link: https://www.cxyxiaowu.com/17124.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
线程和进程的区别?-吴师兄学编程
当前位置:吴师兄学编程 > Java基础面试题 > 线程和进程的区别?

简而言之,进程是程序运行和资源分配的基本单位,一个程序至少有一个进程,一个进程至少有一个线程。进程在执行过程中拥有独立的内存单元,而多个线程共享内存资源,减少切换次数,从而效率更高。线程是进程的一个实体,是cpu调度和分派的基本单位,是比程序更小的能独立运行的基本单位。同一进程中的多个线程之间可以并发执行。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK