1

This is a C# .NET Console application. My parent class will instantiate a child class with:

Thread oThread = new Thread(new ParameterizedThreadStart(oAlpha.init));
oThread.Start(this)

oThread will use iDisposable elements.

Under certain conditions (like when I have updated infomration I want oThread to process instead of old/stale information), I'd like the parent to terminate oThread (the child) at any time and restart it. Should I be calling an event handler in the child to Dispose()?

Is there a clean way to do this without having memory leaks?

Any guidance would be appreciated.

Thanks -Ed

Blorgbeard
  • 97,316
  • 47
  • 222
  • 267
Ed Landau
  • 956
  • 2
  • 10
  • 23
  • There are very good comments about `Thread.Abort` you probably should check out - http://stackoverflow.com/questions/2251964/c-sharp-thread-termination-and-thread-abort – Alexei Levenkov Apr 08 '15 at 05:20

0 Answers0