关键区域和监视器作为同步机制的重要性
我在很多教科书上看到,临界区和监视器都是高级语言提供同步机制的机制。
我在任何文本中都找不到关于这些的更简单的解释。我对这些有些疑问。
编译器实际上是如何实现这些的?
这些东西在C、Java、Python中是否可用。 。 ?
条件构造在监视器和关键区域(条件关键区域)中的重要性是什么
I read in many text books that critical region and monitors are high-level language mechanisms to provide synchronization mechanism.
I couldn't find a simpler explanation about these in any text. I have some doubts on these.
How compiler actually implements these?
Whether these things are available in C, Java, Python . . ?
What is the importance of conditional constructs in monitors and critical region (conditional critical region)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 java 中,监视器是该语言的内置元素。它们可以通过
synchronized
关键字访问,并具有多个与其相关的函数(例如wait()
)。您可以通过谷歌搜索来了解更多相关信息。关于如何实现,有几种实现监视器的算法,各有优缺点。如果你对此感兴趣,请允许我推荐 Herlihy 和 Shavit 的书——多处理器编程的艺术。
In java, monitors are a built-in element of the language. They are accessed by the
synchronized
keyword, and have several functions related to them (such aswait()
). You can google it to find out more about it.Regarding how it is implemented, There are several algorithms that implement monitors, with different pros and cons. If you are interested in this, allow me to recommend Herlihy and Shavit's book - the art of multiprocessor programming.