linux 线程切换效率与进程切换效率相差到底有多大?
2014-11-09 11:38
337 查看
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 线程切换效率与进程切换效率相差究竟有多大?
- linux线程切换和进程切换的方法
- linux中线程的切换
- linux 启动过程临时页表到底映射了多大内存
- Windows和Linux的代码规模到底多大?
- md5与string.Equals的效率差距到底有多大
- 浅谈linux线程切换问题
- linux 启动过程临时页表到底映射了多大内存?
- 怎么理解线程使用而不拥有资源?为什么进程切换的开销比线程切换大呢?
- windows/linux避免多线程应用程序在多核间切换,影响程序效率
- 在Linux-0.11中实现基于内核栈切换的进程切换
- linux 启动过程临时页表到底映射了多大内存?
- 线程创建到底浪有多大消耗
- linux模式切换,进程切换
- 嵌入式 linux下sleep函数到底是线程休眠还是进程休眠
- java,javascript,groovy和Rhino 的运行效率到底相差的有多远?
- Linux到底有没有线程之我见
- 从PCI上读取数据 线程和定时器效率 分类: 浅谈PCI arm-linux-Ubuntu 2013-08-07 08:18 740人阅读 评论(0) 收藏
- Linux 用户线程切换分析
- linux线程切换问题