{"id":1414,"date":"2007-02-18T13:12:46","date_gmt":"2007-02-18T17:12:46","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/2007\/02\/18\/memory-barriers\/"},"modified":"2007-02-19T17:55:57","modified_gmt":"2007-02-19T21:55:57","slug":"memory-barriers","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2007\/02\/18\/memory-barriers\/","title":{"rendered":"Memory Barriers"},"content":{"rendered":"<p>\r\n<a href=\"http:\/\/ridiculousfish.com\/blog\/archives\/2007\/02\/17\/barrier\/\">Peter Ammon<\/a> shows how memory barriers can protect against processor synchronization issues without the expense of locks:\r\n<\/p>\r\n<blockquote cite=\"http:\/\/ridiculousfish.com\/blog\/archives\/2007\/02\/17\/barrier\/\">\r\n<p>The lesson here is something you already knew, but I&#8217;ll state it anyways: <b>Multithreading bugs are very delicate.<\/b> There is a real bug here, but it was masked by the fact that the kernel scheduled them on the same processor, and <i>then<\/i> by the fact that the variables were too close together in memory, and once those two issues were removed, (un)lucky timing usually masked the bug <i>anyways<\/i>.\r\n<\/p>\r\n<\/blockquote>\r\n","protected":false},"excerpt":{"rendered":"<p>Peter Ammon shows how memory barriers can protect against processor synchronization issues without the expense of locks: The lesson here is something you already knew, but I&#8217;ll state it anyways: Multithreading bugs are very delicate. There is a real bug here, but it was masked by the fact that the kernel scheduled them on the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1414","post","type-post","status-publish","format-standard","hentry","category-technology"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=1414"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1414\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=1414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=1414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=1414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}