2

The answer to the question - Implement C# Generic Timeout provides a solution which involves aborting a thread-pool thread. I know the consequences of aborting an explicitly created thread. I guess, the consquences of aborting a thread-pool thread would be more than that of aborting explicit threads. I wonder:

  1. What happens to thread pool thread when it is aborted?
  2. Does the thread becomes completely unusable?
  3. Is the stack memory of aborted thread freed?
  4. What would happen when many thread pool threads are getting aborted? How does the thread pool cope up with such a situation?

Thanks.

Community
  • 1
  • 1
Anand Patel
  • 6,031
  • 11
  • 48
  • 67
  • 3
    One of the biggest problem with the upvoted post is the nasty resource leak it causes. Calling EndInvoke() is *not* optional. Effects will last for 10 minutes. Nobody is going to tell you that you won't have have problems. Well, they shouldn't anyway. If you want to pursue this despite all the red flags then just test it and see what happens. Or do this the smart way and run the code in another process. – Hans Passant Dec 19 '11 at 17:47

0 Answers0