linux 线程切换效率与进程切换效率相差到底有多大?
来源:互联网 发布:linux aria2 多线程 编辑:程序博客网 时间:2024/06/05 00:55
Author:DriverMonkey
Mail:bookworepeng@Hotmail.com
Phone:13410905075
QQ:196568501
Are Linux threads the same as other implementations?
No. They are better -- while mostly keeping the same API. As stated above, most multithreaded OSs define a thread separately from processes. Linus Torvalds has defined that a thread is a "context of execution" (COE). This means that only one process/thread table and one scheduler is needed. Also the scheduler has been optomized so that the switching time for threads vs. tasks varies little--about 1.7us (threads) and 1.8us (fork) on a 75MHz Pentium.
Traditionally, a thread was just a CPU (and some other minimal state) state with the process containing the remains (data, stack, I/O, signals). This would lend itself to very fast switching but would cause basic problems (e.g. what do "fork()" or "execve()" calls mean when executed by a thread?).
Consider Linux threads as a superset of this functionality: they still can switch fast and share process parts, but they can also identify what parts get shared and have no problems with execve() calls. There are four flags that determine the level of sharing:
- linux 线程切换效率与进程切换效率相差到底有多大?
- md5与string.Equals的效率差距到底有多大
- 线程上下文切换与进程上下文切换
- 切换进程 切换线程
- java,javascript,groovy和Rhino 的运行效率到底相差的有多远?
- 线程创建到底浪有多大消耗
- 进程间切换与线程间切换的区别
- 进程、线程 :系统资源 与 上下文切换
- Linux进程调度与进程切换
- Linux中进程调度与进程切换
- 分析linux进程调度与进程切换
- AQTime切换代码覆盖率和效率模式
- linux进程管理之调度与切换
- Linux中进程调度与切换过程
- 进程与线程-2、用户级线程切换过程
- 进程与线程-3、内核级线程切换过程
- Linux内核进程切换
- Linux进程切换分析
- Android getView中的position问题解决方案
- Deep Learning and Shallow Learning
- JNI设置C++与java的结合(2)
- [LeetCode]Search in Rotated Sorted Array
- 计算机视觉、机器学习相关领域论文和源代码大集合
- linux 线程切换效率与进程切换效率相差到底有多大?
- BitMap高效显示策略(三):使用内存缓存技术和BitmapFactory.Options.inBitmap参数
- lucene索引删除,恢复,更新
- android手机摄像:硬编码、软编码实验结果
- linux内核网络协议栈学习笔记:关于GRO/GSO/LRO/TSO等patch的分析和测
- poj1019 Number Sequence
- GDB调试指令
- C++Primer3.6练习题。
- POJ1664放苹果http://poj.org/problem?id=1664