菜菜

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

纤程(Fiber)是一个轻量级的线程,它使用协作完成多任务,而不是使用抢占使用多任务。正在运行的Fiber必须显示让出以此允许其他Fiber运行,这使得Fiber的实现
比内核线程和用户线程简单很多.Java有一个Fiber库

  

协程(Coroutine)是一个组件,它被概括成多个子程序,允许多个进入点来暂停程序和恢复程序。但是和子程序又不一样,当前协程能够通过调用其他协程来退出,这就可能在稍后
返回到在原始协程中调用的它们的位置。


Green Thread 是由VM调用的线程,而不是由下层操作系统调用的线程.Green Thread模拟多线程环境而不用考虑本地OS的兼容能力,它们在用户空间中管理,而不是内核空间中
管理,它们可以在没有本地线程支持的环境中工作。

Java中使用的是Posix标准的Pthread。But

Remember: "Pthreads" is an interface. How it's implemented depends on the platform. Linux uses kernel threads; Windows uses Win32 threads, etc.

"Pthreads" is a library, based on the Posix standard. How a pthreads library is implemented will differ from platform to platform and library to library.

You can query the specific implementation of pthreads under shell using command:

getconf GNU_LIBPTHREAD_VERSION

posted on 2019-07-08 16:31  好吧,就是菜菜  阅读(703)  评论(0编辑  收藏  举报