davidfowl / AspNetCoreDiagnosticScenarios

This repository has examples of broken patterns in ASP.NET Core applications
7.69k stars 740 forks source link

TaskCreationOptions for > .Net 4.6 #59

Open JKamsker opened 4 years ago

JKamsker commented 4 years ago

I know that this Repo is dedicated to AspNet core but which TaskCreationOptions should i take for .net versions below 4.6? In .Net 4.5, TaskCreationOptions.RunContinuationsAsynchronously does not exist.

davidfowl commented 3 years ago

Then you need to be aware of the places that call SetResult or TrySetResult and potentially, they should be doing ThreadPool.QueueUserWorkItem or Task.Run. SignalR does this on .NET Framework https://github.com/SignalR/SignalR/blob/main/src/Microsoft.AspNet.SignalR.Core/Infrastructure/DispatchingTaskCompletionSource.cs