Reputation: 71
Multi threading question:
Is it possible to close the thread that has raised any memory corruption. I want to implement try catch to the memory corruption. And I want to close the thread without causing any damage to the main thread and the whole process.
FYI - This memory exception not happened in Main Thread.
Thanks!
Upvotes: 0
Views: 89
Reputation: 54138
If a thread corrupts memory (unless it's the stack, or a private per-thread heap) then it is of little value to try to isolate the thread. Most heap corruptions will have ripple effects that make the entire process unstable, because all threads generally share the process heap. Worse, it's going to be unpredictable how and when things all fall apart in the end.
Your dev resources are better spent in fixing the bug than in trying to mitigate its side effects. If this is indeed manifesting as a reproducible exception in the failing thread, Process Dumper may be useful in generating a process image snapshot from the time of the problem arising.
Upvotes: 3