Beautiful Proof - Data-Race-Free Implies Sequential Consistency

本文解释了在遵循简单的同步规则(如使用互斥锁避免数据竞争)的情况下,程序的执行将表现出一种可按其相应的顺序一致执行进行推理的行为。这意味着,如果程序没有数据竞争,那么它将具有顺序一致性,这是最直观的一致性模型。这为程序员提供了一个保证,即通过确保程序无数据竞争,可以得到顺序一致性,同时允许编译器、虚拟机和硬件进行大量优化。
摘要由CSDN通过智能技术生成

Beautiful Proof - Data-Race-Free Implies Sequential Consistency

 

刘未鹏(pongba)

C++的罗浮宫(http://blog.csdn.net/pongba)

 

Disclaimer: You should first (but not the least) understand the fundamentals of multithreading memory models to be able to read the following text. I personally recommend you start with the related C++0x memory model proposals if you’re a C++ programmer, or the java memory model if you’re a java programmer. That being said, the principles behind the proof apply to all kinds of the so-called data-race-free models.

If it happens that you’ve been slogging through all the glories proposals of C++0x memory model, and found yourself tripped up by the proof in question. Then you’ll find this post useful. Otherwise I suggest you at least read this paper before going on.

I do assume that you have a sufficient understanding of the fact that multithreading is becoming, if not has already become, the next big event and general skill in the programming field. There’re flames all over the places. And since C++ is one of my favorite programming languages, and, unfortunately one that has not included a multithreading memory model of some sort (well, not until C++0x is published), I kept tracking of all the progress that has been made with respect to it. It turns out that multithreading is this extremely tricky yet interesting business.

OK, enough said, let’s get down to business. Just one last thing though, I only write this post to explain the proof informally, so this is not going to be like an “Introduction to C++0x memory model” post (although I do have the plan to write one of those, just so long as there’s enough time), instead, I’ll go without any further preamble. For those of you who’re not familiar with the upcoming, brand-new C++0x memory model, and do consider yourself a C++ programmer (or, you know, a programmer in general), I strongly suggest you start now.

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值