title: What is "thread local storage" in Python, and why do I need it?
body: <p>In Python specifically, how do variables get shared between threads?</p>
  
  <p>Although I have used <code>threading.Thread</code> before I never really understood or saw examples of how variables got shared.  Are they shared between the main thread and the children or only among the children? When would I need to use thread local storage to avoid this sharing?</p>
  
  <p>I have seen many warnings about synchronizing access to shared data among threads by using locks but I have yet to see a really good example of the problem. </p>
  
  <p>Thanks in advance!</p>