java - 轻量级线程和重量级线程的定义是什么,他们的区别是什么?如何区分?
巴扎黑
巴扎黑 2017-04-18 10:31:16
0
2
636

通常说java的是重量级线程,python,erlang等是轻量级线程,请问为什么这样说?他们的区别是什么?如何区分重量级线程和轻量级线程?

巴扎黑
巴扎黑

reply all(2)
PHPzhong
  • Heavyweight threads are real threads in the operating system, and users do not have strong control over them

  • Lightweight threads are actually pseudo-threads. Users have more control over it, and the same is true for coroutines in golang: they are scheduled by the go language itself.

洪涛

Processes and threads are concepts that can be identified at the operating system level, which means that processes and threads can find corresponding IDs in the operating system. That is, heavyweight.
Coroutines are finer-grained units of work than threads.
There is also the concept of coroutine in java: http://www.blogjava.net/BlueD...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!