Hello, thanks for the series of articles about multithreading, very helpful!
Noticed a subtle mistake:
In this example:
ReactorEventDispatcher.HeatCritical += async () => {
var triggerShutdownTask = Task.Run((Action) ReactorEventDispatcher.TriggerSafetyShutdown);
you should have written: triggerShutdownTask.Wait();
to achieve a deadlock,
otherwise: await triggerShutdownTask
will return execution to calling context with no problems.
Hi Alexander, thanks for the correction. I’m currently in the process of migrating the blog to a new platform and once that is complete I’ll write up an edit regarding your comment.
Hello, thanks for the series of articles about multithreading, very helpful!
Noticed a subtle mistake:
In this example:
ReactorEventDispatcher.HeatCritical += async () => {
var triggerShutdownTask = Task.Run((Action) ReactorEventDispatcher.TriggerSafetyShutdown);
};
you should have written:
triggerShutdownTask.Wait();
to achieve a deadlock,
otherwise:
await triggerShutdownTask
will return execution to calling context with no problems.
LikeLike
Hi Alexander, thanks for the correction. I’m currently in the process of migrating the blog to a new platform and once that is complete I’ll write up an edit regarding your comment.
Thanks, and merry Christmas :)
LikeLike