A way to notify parent thread when child thread was killed or interrupted

I have a multithreading application in C#. Child threads do some serious work and I want know when child thread was killed to rerun it. What is the correct way to do it?

Jon Skeet
people
quotationmark

You'd be best off using the Task Parallel Library introduced in .NET 4. That way you can add a continuation to execute on failure (or cancellation, or success). Call Task.ContinueWith and pass in the continuation.

Tasks are generally the preferred approach to concurrency as of .NET 4. They compose well, they can represent operations which return values, they can represent asynchronous operations, they're the basis of async/await in C# 5... they're generally good :)

people

See more on this question at Stackoverflow