threads线程(编辑修改稿)内容摘要:

Tru64 UNIX BeOS 处理机  Advantages  the kernel can simultaneously schedule many threads of the same process on many processors 内核可在多处理机上同时对一个进程的多个线程进行调度  blocking is done on a thread level 阻塞仅限线程级别  kernel routines can be multithreaded 内核程序也可以是多线程  Inconveniences  thread switching within the same process involves the kernel. We have 2 mode switches per thread switch 同进程的线程内的转换涉及内核 ,每一个线程的转换需要两个模式转换  this results in a significant performance slowing down 导致系统性能的下降 内核级的线程 Multithreading Models 多线程模式  ManytoOne (多对一 )  OnetoOne (一对一 )  ManytoMany (多对多 ) ManytoOne  Many userlevel threads mapped to single kernel thread.( 纯用户级线程)  Used on systems that do not support kernel threads.(常用 于不支持内核线程的 系统中 ) OnetoOne  Each userlevel thread maps to kernel thread. ( 纯核心级线程)  Examples – Windows 95/98/NT/2020 – OS/2 ManytoMany Model 混合式线程  Allows many user level threads to be mapped to many kernel threads.  Takes advantage of manytoone and onetoone models  Allows the operating system to create a sufficient(充足的 ) number of kernel threads.  例子 – Solaris 2 – Windows NT/2020 with the ThreadFiber纤程package ManytoMany Model  Thread pools (线程池 ) - avoid too many threads from exhausting system resources(CPU,memory,etc.) 避免过多的线程耗尽系统资源 - a pool of threads is created in advance to sit and wait for work (在线程。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。