首页 > 技术相关 > 存储一致性之严格一致性(Strict Consistency)

存储一致性之严格一致性(Strict Consistency)

2011年5月6日 发表评论 阅读评论

定义:

Any read to a memory location X returns the value stored by the most recent write operation to X.

中译为(看起来真简洁,不得不感慨下汉语的简洁性,不过和简洁相伴的往往是不准确性):

从存储器地址X处读出的值为最近写入X的值。

严格一致性要求具有决定最近写的能力,因此它蕴涵请求的全序。

传统意义上,单处理机遵守严格一致性,单处理机的编程者正希望这样。但是在分布式计算机系统中为每个与准确的全局时间对应的操作分配惟一的时间戳是不可能的。

可以放宽条件,将时间分割成一系列连续的、不重叠的时间间隔。假设每个操作发生在一个时间间隔内,并获得与那个时间间隔对应的时间戳。

但是无法保证每个时间间隔内最多只发生一个单一操作。因此,仍需要处理在同一时间间隔内所发生的多个操作。如果同一时间间隔内的两个操作是对相同数据进行操作,并且其中一个操作是写操作,那么称这两个操作是冲突的。

另一方面,编程人员却希望能够满足严格一致性。如果不支持严格一致性,程序发生问题就很难说是那方面的问题。定义一致性模型的一个重要问题就是准确定义出现冲突时,哪些行为是可接受的。

如果一个进程的两个事件发生如此之快,以致其他进程不能在此之间执行任何操作,那可能会带来麻烦。相反,通常的编程方式是:语句执行的确切时间(实际上是存储器访问)并不重要,而当事件(读或写)的顺序是至关重要时,可以使用信号量等方法实现同步操作。接受这种意见意味着采用较弱的一致性模式来编程。经过几次实践,大多数并行程序编写人员都能适应这种模式。因此,程序设计者使用较弱的一致性模式同样可以使存储器正常工作。这些工作将在后面几篇文章介绍。

总之,对于严格一致性的存储器,写操作在任一时刻对所有进程都是可见的,同时维护一个绝对全局时间顺序。一旦存储器中的值改变,不管读写之间的事件间隔多小,不管哪个进程执行读操作,也不管进程在何处,以后读出的都是新更改的值。同样,如果执行了读操作,不管后面的写操作有多迅速,该读操作仍应读出原来的值。

严格一致性的示意图:



本文作者: Sigma    在新浪微博关注SigmaSigmaWeibo    RSS订阅本博客
本文链接: http://www.sigma.me/2011/05/06/strict-consistency.html
本博客采用知识共享署名—非商业性-禁止演绎使用3.0协议进行许可,转载请保留作者和原文链接。

  1. 2019年1月14日17:20 | #1

    My wife and i ended up being so ecstatic Peter could finish up his inquiry while using the precious recommendations he made from your very own site. It is now and again perplexing just to always be offering guides that many people might have been selling. Therefore we do understand we have the blog owner to thank for this. Those illustrations you have made, the easy web site navigation, the friendships you make it easier to instill – it is everything fabulous, and it is letting our son in addition to us do think that idea is pleasurable, which is certainly really vital. Many thanks for the whole thing!

  2. 2019年1月15日21:14 | #2

    I wanted to draft you a little bit of note to be able to give thanks again over the nice tips you’ve shown in this article. It was simply surprisingly open-handed with people like you to present unhampered just what most people could possibly have offered for sale as an electronic book to make some money on their own, principally considering that you could possibly have done it if you desired. The basics as well served like the good way to comprehend other individuals have the identical keenness just as my own to realize a great deal more concerning this problem. I am sure there are many more fun instances in the future for folks who look over your site.

  3. 2019年1月16日05:46 | #3

    I together with my pals were actually looking at the good advice found on your site and then unexpectedly I got a terrible suspicion I had not thanked the web site owner for those techniques. The guys appeared to be for that reason joyful to see them and have certainly been enjoying them. Thank you for truly being really thoughtful and also for considering variety of important topics millions of individuals are really eager to learn about. My personal sincere apologies for not expressing appreciation to you earlier.

  4. 2019年1月16日09:50 | #4

    I have to express some appreciation to this writer just for bailing me out of this type of dilemma. After researching through the search engines and coming across views that were not beneficial, I was thinking my entire life was gone. Living without the presence of approaches to the difficulties you’ve resolved through your article is a crucial case, and the kind which could have in a wrong way affected my career if I hadn’t come across the blog. Your primary training and kindness in handling a lot of stuff was precious. I’m not sure what I would have done if I hadn’t discovered such a subject like this. I can at this point look forward to my future. Thanks for your time very much for the reliable and effective help. I won’t be reluctant to refer your blog post to anybody who wants and needs guidance about this situation.

  5. 2019年1月16日13:49 | #5

    I wish to voice my admiration for your kindness in support of those people who have the need for assistance with that idea. Your personal commitment to passing the message along appeared to be pretty invaluable and have in every case helped girls like me to attain their objectives. Your new important hints and tips means a great deal to me and even more to my peers. Regards; from all of us.

  6. 2019年1月17日00:43 | #6

    I not to mention my pals were found to be looking through the great procedures from the blog and unexpectedly I had a horrible suspicion I never thanked the website owner for those secrets. These boys happened to be so joyful to learn all of them and have in effect truly been tapping into these things. Thank you for being so accommodating and for considering such impressive guides most people are really eager to be aware of. My personal honest apologies for not expressing appreciation to you earlier.

  7. 2019年1月17日17:14 | #7

    I am glad for commenting to make you know what a amazing encounter my girl developed browsing your web page. She even learned a wide variety of things, not to mention what it’s like to have an amazing teaching spirit to have a number of people really easily fully grasp specified complicated subject matter. You undoubtedly surpassed her expectations. I appreciate you for rendering the practical, dependable, informative as well as cool thoughts on this topic to Gloria.

  8. 2019年1月18日03:22 | #8

    I truly wanted to jot down a quick comment so as to thank you for those fantastic ways you are writing at this site. My time intensive internet look up has finally been honored with high-quality tips to exchange with my family members. I would state that that many of us site visitors are rather lucky to dwell in a really good community with very many outstanding individuals with helpful tricks. I feel very much happy to have used your web site and look forward to many more awesome moments reading here. Thank you once again for all the details.

  9. 2019年1月18日18:14 | #9

    Thank you a lot for giving everyone such a special opportunity to read from this blog. It’s usually very pleasing and also stuffed with a great time for me personally and my office acquaintances to visit your site particularly three times in a week to find out the new guidance you have got. And lastly, we are certainly motivated with all the unbelievable thoughts you give. Some 3 tips on this page are surely the very best we have all ever had.

  10. 2019年1月19日06:11 | #10

    My wife and i have been really happy Jordan could complete his web research out of the precious recommendations he grabbed while using the web site. It is now and again perplexing to just be offering information and facts which often many others might have been making money from. We really realize we’ve got the blog owner to give thanks to because of that. All of the illustrations you made, the easy web site menu, the friendships you can make it easier to engender – it is everything overwhelming, and it’s letting our son in addition to the family reason why that matter is awesome, and that’s incredibly indispensable. Thanks for all!

  11. 2019年1月20日21:07 | #11

    I am only commenting to make you know what a fine discovery my wife’s princess obtained visiting your site. She discovered some issues, with the inclusion of what it is like to have a great coaching spirit to make many people completely completely grasp several impossible topics. You undoubtedly did more than our own expected results. Thank you for giving these helpful, dependable, edifying and even unique tips about that topic to Kate.

  12. 2019年1月21日20:28 | #12

    My husband and i were now joyful Ervin could conclude his inquiry with the ideas he was given when using the web page. It’s not at all simplistic to just happen to be freely giving procedures that many others may have been trying to sell. We fully understand we have got the blog owner to be grateful to for this. The most important explanations you made, the easy website navigation, the relationships you will make it easier to create – it’s got many terrific, and it’s really aiding our son and us recognize that the situation is brilliant, which is certainly tremendously important. Thanks for the whole lot!

  13. 2019年1月22日02:25 | #13

    I intended to draft you one bit of remark to be able to say thanks a lot as before with your nice tricks you’ve shown in this case. It is quite extremely open-handed of people like you in giving extensively what some people would have advertised as an electronic book to generate some dough for their own end, notably considering that you could have tried it if you wanted. These basics likewise acted as a good way to fully grasp that other people have the identical fervor the same as my own to figure out a great deal more with respect to this issue. I’m certain there are a lot more fun instances ahead for people who examine your website.

  14. 2019年1月22日05:58 | #14

    I intended to post you a very little note to help give many thanks once again with your unique principles you’ve documented here. It is wonderfully open-handed with people like you to deliver openly what exactly a few people could have marketed for an e book to earn some profit on their own, specifically considering that you could possibly have done it in the event you wanted. These things as well acted to become a easy way to be certain that many people have similar zeal similar to my own to find out a little more in respect of this condition. I’m certain there are millions of more pleasurable opportunities up front for many who take a look at your blog.

  15. 2019年1月22日14:09 | #15

    Thank you so much for providing individuals with an extraordinarily wonderful possiblity to check tips from this site. It’s usually very beneficial and also packed with a great time for me and my office peers to visit your site at the least three times weekly to see the newest things you have. And indeed, we’re usually fulfilled concerning the superb pointers you give. Certain 3 tips in this post are rather the most effective I’ve ever had.

  16. 2019年1月23日00:17 | #16

    I and also my friends have already been looking through the nice tips and hints located on the website then then came up with a terrible feeling I never thanked the web blog owner for those techniques. Those boys are actually absolutely warmed to read all of them and already have simply been loving those things. Thank you for genuinely indeed kind and then for settling on varieties of incredible tips most people are really desperate to discover. My personal sincere regret for not expressing gratitude to you earlier.

  1. 2018年5月22日14:07 | #1

无觅相关文章插件,快速提升流量