《Operating System Concepts》学习第 28 天,p286-p308 总结,总计 23 页。
一、技术总结
1.reentrant lock(可重入锁)
(1)为什么称为 reentrant lock?
A thread acquires a ReentrantLock lock by invoking its lock() method. If the lock is available—or if the thread invoking lock() already owns it, which is why it is termed reentrant—lock() assigns the invoking thread lock ownership and returns control.
(2)Python 中的 rerentrant lock
threading.RLock。
二、英语总结(生词:2)
1.hazard
c. sth that is dangerous and likely to cause damage(危害,风险,隐患)
示例:We also discussed various challenges in designing applications that are free from race conditions, including liveness hazards such as deadlocks (《Operating System Concepts》第 287 页)。
在上面这个例子中,liveness 不是 harzard, deadlock是hazard, 是一种liveness hazard,即“liveness hazard refers to situations where liveness is compromised, such as deadlock”。
2.adverse
(1) adverse: ad-(“toward, against”) + vetere(“to turn”)
adj. Adverse literally means “to turn against(反对),opposing(相反的)”. having a negative or harmful effect on sth(负面的,不利的)。
(2)示例:
Obviously, if two readers access the shared data simultaneously, no adverse effects will result(《Operating System Concepts》第 291 页)。
关于英语的注解同步更新汇总到 https://github.com/codists/English-In-CS-Books 仓库。
三、其它
第 6 章(Synchronization Tools)简评:介绍了 Crititical-Section, Peterson’s Solution,Mutext Locks, Semaphore, Monitor, Liveness。因为对这些内容不了解,所以对作者所说的内容很难有切身体会,如 Synchronization Tools 包含哪些?那么问题就变成了:1、怎么把书上的内容和实际应用结合起来?2.自己不知道这些内容,是因为平时工作中没有用到,还是用到了但是因为自己忽视了?这是本人阅读第 6 章的感受。
四、参考资料
1. 编程
(1) Abraham Silberschatz,Peter Baer Galvin,Greg Gagne《Operating System Concepts》:https://book.douban.com/subject/30272539/
2. 英语
(1) Etymology Dictionary:https://www.etymonline.com
(2) Cambridge Dictionary:https://dictionary.cambridge.org
欢迎搜索及关注:编程人(a_codists)