title: global counter in application: bad practice?
body: <p>In my C++ application I sometimes create different output files for troubleshooting purposes.  Each file is created at a different step of our pipelined operation and it's hard to know file came before which other one (file timestamps all show the same date).</p>
  
  <p>I'm thinking of adding a global counter in my application, and a function (with multithreading protection) which increments and returns that global counter.  Then I can use that counter as part of the filenames I create.</p>
  
  <p>Is this considered bad practice?  Many different modules need to create files and they're not necessarily connected to each other.</p>