<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>c/c&#43;&#43; on Shylock Hg</title>
    <link>/tags/c/c&#43;&#43;/</link>
    <description>Recent content in c/c&#43;&#43; on Shylock Hg</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 05 Aug 2019 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="/tags/c/c++/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Thread Local Storage</title>
      <link>/post/2019/08/05/thread-local-storage/</link>
      <pubDate>Mon, 05 Aug 2019 00:00:00 +0000</pubDate>
      
      <guid>/post/2019/08/05/thread-local-storage/</guid>
      <description>In c The key word __thread in gcc will specify the static storage symbol to each thread. So each thread will own one instance of the symbol belong to itself. Such as below:
__thread int i; extern __thread FILE* f; // Just pointer, need create structure on each thread static __thread char* s; // Just pointer need create string on each thread int func(void) { static __thread int b; }  The macro thread_local in threads.</description>
    </item>
    
  </channel>
</rss>