title: Terminate a Thread running code I can't control
body: <p>I am doing a project where I am loading several assemblies during runtime, for each of those assemblies I use reflection to find some specific classes, instantiate them and calling their methods. All this is working fine, but for some of the calls the process encounters a stack overflow which terminates my entire program. I don't have any control over the source code of the assemblies I am loading so I cant change the code I'm executing.</p>
  
  <p>What I have tried to solve the problem:</p>
  
  <ol>
  <li><p>I assign a thread to do the invocation of the methods and tried to<br>
  abort the thread after a timeintervall(I know that this is bad
  practice but I cant change    the code to terminate friendly). This
  however doesn't work, I think the thread is to busy "stackoverflowing"
  to handle the Abort-call. </p></li>
  <li><p>Ive tried reducing the actual memory the thread has access to, this is not even a solution because you cant catch the stackoverflow-exception so my program terminates anyway (just        quicker)</p></li>
  </ol>
  
  <p>Questions:</p>
  
  <ol>
  <li>Can a thread be to busy to be aborted? Is there some way to abort a thread that is having this behaviour?</li>
  <li>How can we call code (that we don't have any control over) in a good way?</li>
  </ol>
  
  <p>Thanks in advance!</p>