- 11
- 0
- 约1.26万字
- 约 9页
- 2015-09-27 发布于重庆
- 举报
Spinlock技术与应用
Spin-lock技术及应用
在 Linux Kernel 里有着许多重要的资料结构,这些资料在作业系统的运作中扮演着举足轻重的角色。然而,Linux 是个多任务的作业系统,也就是在同一时间里可以同时有许多的行程在执行,所以,很有可能某个行程在依序读取 inode list,同时却又有另一个在 inode list 里加入新的 inode,这会造成什幺情形呢?这会造成 inode list 的不稳定。所以,在 Kernel 里,我们需要一个机制,可以使得当我们在修改某个重要的资料结构时,不能被中断,即使被中断了,这个资料结构由于还没修改完,别的行程也都不能去读取和修改它。Linux Kernel提供了 spinlock 这个机制可以使我们做到这样的功能。
有的人会想到当我们在修改某个重要的资料结构时,将中断都 disable 掉就好了,等修改完了再将中断 enable 不就得了,何必还要再提供一个 spinlock 来做同样的事。在 uni-processor 的环境底下,的确是如此。所谓 uni-processor 就是指只有一个 CPU 的电脑,但是在SMP的环境下就不是这幺一回事了。
我们知道现在 Linux 已经有支持 SMP,也就是可以使用多颗 CPU 来加
您可能关注的文档
- OpenGL入门学习之十一——纹理的使用入门.pdf
- Operations Research in the United Arab Emirates Current Status and Future Diffusion.pdf
- opengl配置过程中遇到的问题.doc
- Optical Communications Systems Reliability Evaluation A New Approach.pdf
- Optical Determination of the Lattice Constants of.pdf
- Optimization Research on Transfer between Urban Subway and Bus Based on the Adjacency Matrix.pdf
- Optimum Gate Design of FreeForm Injection Mould using the.doc
- oracle awr报告生成与分析.doc
- Oracle Cursor And Shared Cursor 游标的概念绑定变量减少硬解析.pdf
- Ordered Binary Decision Diagrams and Their Significance in ComputerAided Design of VLSI Ci.pdf
原创力文档

文档评论(0)