title: Are there advantages to a crashing on a secondary thread versus the main one?
body: <p>I came across this code in a large codebase</p>
  
  <pre><code>DWORD WINAPI ThreadFunc (LPVOID lpParam)
  { 
      int *x = 0;
      *x = 1234; // Access violation
  
      return 0; 
  }
  
  void Manager::Crash ()
  {
      Log("Received a remote command to crash Server.");
  
      DWORD dwThreadId, dwThrdParam = 1; 
      HANDLE hThread = ::CreateThread(NULL, 0, ThreadFunc, &amp;dwThrdParam, 0, &amp;dwThreadId);
  } 
  </code></pre>
  
  <p>My question is: Why is it using a thread? Would it be more or less threadsafe if the code in <code>ThreadFunc</code> was done directly in <code>Manager::Crash</code>? I am reluctant to make changes in case I remove the crash.</p>