{"id":9013,"date":"2011-11-29T07:00:00","date_gmt":"2011-11-29T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2011\/11\/29\/things-ive-written-that-have-amused-other-people-episode-8\/"},"modified":"2011-11-29T07:00:00","modified_gmt":"2011-11-29T07:00:00","slug":"things-ive-written-that-have-amused-other-people-episode-8","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20111129-00\/?p=9013","title":{"rendered":"Things I&#039;ve written that have amused other people, Episode 8"},"content":{"rendered":"<p>\nIn a technical discussion, I opened a reply with\n<\/p>\n<blockquote CLASS=\"q\"><p>\nBob&#8217;s paper which I haven&#8217;t yet read points out that&#8230;\n<\/p><\/blockquote>\n<p>\nSome people wrote to me to say that the&#8217;ve added this quote to their file\nin the hopes of being able to use it themselves someday.\n<\/p>\n<p>\nFor those who are curious, I found the technical discussion in question.\nIt had to do with whether the following code is thread-safe:\n<\/p>\n<pre>\n\/\/ initial conditions\nint x = 1, y = 0;\nint *p = &amp;x;\n\/\/ Thread 1 executes this\ny = 1;\nMemoryBarrier();\np = &amp;y;\n\/\/ Thread 2 executes this\nprint *p;\n<\/pre>\n<p>\nQuestion: Can this code legitimately print <code>0<\/code>?\n<\/p>\n<p>\nSurprisingly,\n<a HREF=\"http:\/\/www.cs.umd.edu\/~pugh\/java\/memoryModel\/AlphaReordering.html\">\nthe answer is <i>yes<\/i><\/a>!<\/p>\n<p>\n","protected":false},"excerpt":{"rendered":"<p>In a technical discussion, I opened a reply with Bob&#8217;s paper which I haven&#8217;t yet read points out that&#8230; Some people wrote to me to say that the&#8217;ve added this quote to their file in the hopes of being able to use it themselves someday. For those who are curious, I found the technical discussion [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[103],"class_list":["post-9013","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-non-computer"],"acf":[],"blog_post_summary":"<p>In a technical discussion, I opened a reply with Bob&#8217;s paper which I haven&#8217;t yet read points out that&#8230; Some people wrote to me to say that the&#8217;ve added this quote to their file in the hopes of being able to use it themselves someday. For those who are curious, I found the technical discussion [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/9013","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=9013"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/9013\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=9013"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=9013"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=9013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}