title: How/where is the working directory of a program stored?
body: <p>When a program accesses files, uses <code>system()</code>, etc., how and where is the current working directory of that program physically known/stored?  Since logically the working directory of a program is similar to a global variable, it should ideally be thread-local, especially in languages like D where "global" variables are thread-local by default.  Would it be possible to make the current working directory of a program thread-local?  </p>
  
  <p>Note:  If you are not familiar with D specifically, even a language-agnostic answer would be useful.</p>