{"id":2376,"date":"2019-12-07T17:08:57","date_gmt":"2019-12-07T22:08:57","guid":{"rendered":"https:\/\/bitpost.com\/news\/?p=2376"},"modified":"2020-06-03T18:26:28","modified_gmt":"2020-06-03T23:26:28","slug":"c11-thread_local-set-us-up-the-bomb","status":"publish","type":"post","link":"https:\/\/bitpost.com\/news\/2019\/c11-thread_local-set-us-up-the-bomb\/","title":{"rendered":"C++11 thread_local set us up the bomb"},"content":{"rendered":"\n<p>The thread_local scope tells the compiler to create one unique version of a variable per thread.  Then you can access it without worrying at all about in what thread you are.  (Grammar Nazis, help me out here.  I think I got that right&#8230;)  It is absolutely genius for making multi threaded programming that much easier.  W00t.<\/p>\n\n\n\n<p>UPDATE: of course, every razor blade comes with its share of nicks.  In this case, the expectation that different objects in the same thread would still have different thread_local members.  Nope!  Vet your ideas before you change to this scope too fast!  Me, I&#8217;m all better now, and still love it.  Good luck girls and boys.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The thread_local scope tells the compiler to create one unique version of a variable per thread. Then you can access it without worrying at all about in what thread you are. (Grammar Nazis, help me out here. I think I got that right&#8230;) It is absolutely genius for making multi threaded programming that much easier. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[204,22,19],"tags":[301],"class_list":["post-2376","post","type-post","status-publish","format-standard","hentry","category-a-better-trader","category-cpp","category-opensource","tag-thread_local"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9M11L-Ck","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/comments?post=2376"}],"version-history":[{"count":3,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2376\/revisions"}],"predecessor-version":[{"id":2399,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/2376\/revisions\/2399"}],"wp:attachment":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/media?parent=2376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/categories?post=2376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/tags?post=2376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}