We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
尝试 Tanenbaum 的操作系统:设计和实现。
编辑:或现代操作系统。我认为第一个包括 Minix,第二个不包括。不确定,抱歉=(
它是学术导向的,所以它会让你开始走上正确的道路。
Try Tanenbaum's Operating Systems: Design and Implementation.
edit: or Modern Operating Systems. I think the 1st one includes Minix, the 2nd one doesn't. Not sure, sorry =(
It's academically oriented, so it'll get you started on the right path.
无论如何都不是完整的参考,但以下论文对于理解 Linux 中同步原语的实现来说是经典且必不可少的:
“Fuss、Futexes 和 Furwocks:Linux 中的快速用户级锁定”,Franke Russell & Kirkwod,2002 年渥太华 Linux 研讨会论文集 - 可在以下位置(以及其他)获取: http://www.cis.temple.edu/~ingargio/cis307/readings/futex0.pdf
从该内容和 glibc 源代码中可以学到很多东西,但这不是我所说的简单 -去 :-)
Not a complete reference by any means, but the following paper is a classic and essential for understanding the implementation of synchronisation primitives in Linux:
"Fuss, Futexes and Furwocks: Fast Userlevel locking in Linux", Franke Russell & Kirkwod, Proceedings of the Ottawa Linux Symposium 2002 - available (among others) at: http://www.cis.temple.edu/~ingargio/cis307/readings/futex0.pdf
From that and the glibc sources it's possible to learn a lot, but it's not what I'd call easy-going :-)
附带说明一下,如果您只想要原子性的东西并且正在使用 gcc,那么您可以使用一些内置函数来代替 asm。
http://gcc.gnu.org/onlinedocs/gcc -4.1.2/gcc/Atomic-Builtins.html
但是对于特定的锁,你总是有维基百科
http ://en.wikipedia.org/wiki/Spinlock
http://en.wikipedia .org/wiki/Semaphore_(programming)
另外值得一看的是
http:// /en.wikipedia.org/wiki/Lock-free_and_wait-free_algorithms
As a side note, if you just want atomic stuff and you'r using gcc you have some built in functions that you can use instead of asm.
http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html
But for specific locks you always have Wikipedia
http://en.wikipedia.org/wiki/Spinlock
http://en.wikipedia.org/wiki/Semaphore_(programming)
Also worth looking at is
http://en.wikipedia.org/wiki/Lock-free_and_wait-free_algorithms