You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This differs from the .NET Framework 4.5 behavior. Example of what can go wrong:
// UI threadawaitTask.Run(async()=>{// Thread pool threadDoCPUIntensiveWork();awaitDoIOBoundWorkAsync();// PROBLEM: the await resumes on the UI thread, not a thread pool thread!DoCPUIntensiveWork();// Ends up blocking the UI thread});
The workaround is to await DoIOBoundWorkAsync().ConfigureAwait(false). (Once v0.3.0 is out with the fix for #7!) To be clear, ConfigureAwait(false) is better code, but it should still not be necessary.
Recommend closing all TaskParallelLibrary 1.0.2856 bugs as won't fix with a known workaround. No one has binding redirects in place for this and trying to re-port this is going to be a mess.
There's another reason to re-port: net20 support. There is a measurable difference between running against the net20 BCL and the net35 and net45 BCLs, and we at NUnit have not been excited about dropping support for old targets, so I'm actually looking for this at the moment.
For reference, this demonstrates the bug: https://github.com/jnm2/AsyncBridge/compare/sync_context_flow_bug
This differs from the .NET Framework 4.5 behavior. Example of what can go wrong:
The workaround is to await
DoIOBoundWorkAsync().ConfigureAwait(false)
. (Once v0.3.0 is out with the fix for #7!) To be clear,ConfigureAwait(false)
is better code, but it should still not be necessary.Looks like another easy fix. The problem is, the source code for TaskParallelLibrary 1.0.2856 is not on the internet as far as I can tell. The nupkg and binaries are first committed to this repo in f97269a and had been downloaded from https://www.nuget.org/packages/rx-core/1.0.2856. I've scoured https://rx.codeplex.com/ and https://github.com/Reactive-Extensions/Rx.NET and am pretty sure they do not contain the source of System.Threading.dll from TaskParallelLibrary.
At this point it seems likely that creating a fresh net47-net35 or perhaps corefx/net35 shim from scratch in a single DLL would be cleanest.
The text was updated successfully, but these errors were encountered: