title: Can hotshot be used in multiple threads?
body: <p>I have a long-running multithreaded program, and I'd like to occasionally like to call a function with <a href="http://docs.python.org/library/hotshot.html#hotshot.Profile.runcall" rel="nofollow noreferrer">Profile.runcall</a> and dump the data to a file.</p>
  
  <p>The <a href="http://docs.python.org/library/hotshot.html" rel="nofollow noreferrer">hotshot documentation</a> states: <code>Note: The hotshot profiler does not yet work well with threads. It is useful to use an unthreaded script to run the profiler over the code you’re interested in measuring if at all possible.</code></p>
  
  <p>However, I've test having multiple threads profile a function simultaneously, and I've encountered no problems.  In my case, the functions being profiled are all self-contained and do not spawn any additional threads during execution.  And I make sure that every <code>Profile</code> object has its own file so that they don't clobber each other.</p>
  
  <p>So my guess is that the warning about multiple threads means that I would have problems if the function being profiled spawned additional threads itself.  When I profile a test function that does spawn other threads, the spawned threads are not profiled.  However, this still doesn't seem to cause any problems, since the function being profiled seems to work just fine.</p>
  
  <p>Can someone confirm or refute that hotshot is safe to run in a multithreaded program?  I don't want to deploy something that might crash later, even if it seems to pass my initial tests.</p>