Home  >  Q&A  >  body text

java - 轻量级线程和重量级线程的定义是什么,他们的区别是什么?如何区分?

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

巴扎黑巴扎黑2721 days ago614

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-18 10:33:16

    • 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.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:33:16

    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...

    reply
    0
  • Cancelreply