Repository navigation
Conversation
6a57e2b to
a3bb61b
Compare
weltkante
left a comment
There was a problem hiding this comment.
Doesn't look correct to me, multithreading is hard :-/
What doesn't look correcT? |
Sorry, github didn't take my comments, I'll review again. Might have already adressed some of them ;-) |
No worries... I'm done for the day, no more force-pushes from me until tomorrow ;) |
a3bb61b to
bd1d8f3
Compare
|
Looks better to me now. Having read through it a few times I'm starting to feel a bit iffy on the cancellation. I think the old I wonder if its possible to get the PictureBox stuck in a canceled loading state:
Considering that the only point of the You'll probably want to take someone elses opinion on this, multithreading is indeed hard :-( |
Async delegates have been deprecated in .NET Core (see https://github.com/dotnet/corefx/issues/5940) for reasons such as: * Async delegates use deprecated IAsyncResult-based async pattern. This pattern is generally not supported throughout .NET Core base libraries. * Async delegates depend on remoting (System.Runtime.Remoting) under the hood. Remoting is not supported in .NET Core. For more detailed reasons and migration strategies please refer to https://devblogs.microsoft.com/dotnet/migrating-delegate-begininvoke-calls-for-net-core/ In case of WinForms, async pattern predates the Task-based Asynchronous Pattern and it does not return awaitables. In order to minimise the change to the public API surface we continue to expose the existing API and just re-route the image loading routine to a `Task` runner under the covers. Fixes dotnet#242 Fixes dotnet#1548
bd1d8f3 to
e8bb804
Compare
Codecov Report
@@ Coverage Diff @@
## release/3.0 #1696 +/- ##
====================================================
- Coverage 25.95534% 25.9456% -0.00974%
====================================================
Files 804 804
Lines 267706 267714 +8
Branches 37950 37951 +1
====================================================
- Hits 69484 69460 -24
- Misses 193295 193327 +32
Partials 4927 4927
|
|
Your multi-threading kung-fu is better than mine and reasoning is more sound 😄 |
|
The fix is signed off by CTI, no regressions found. |
|
Tactics approved after final code reviews. |
|
@RussKie this is good to go. Please merge at your leisure |
| { | ||
| // Invoke BeginGetResponse on a threadpool thread, as it has unpredictable latency | ||
| req.BeginGetResponse(new AsyncCallback(GetResponseCallback), req); | ||
| }); |
There was a problem hiding this comment.
@stephentoub Can con confirm this is the expected translation for a BeginInvoke usage like this?
There was a problem hiding this comment.
This is reasonable.
(Though I don't think the comment is relevant on .NET Core, so it's not clear how relevant this queueing is anymore. Plus, it'd be better to switch to a cached HttpClient instead of using WebRequest.)
There was a problem hiding this comment.
Plus, it'd be better to switch to a cached HttpClient instead of using WebRequest
Certainly, Sam has already flagged it offline.
We will replace WebRequest in .NET 5.0
Fixes #242
Fixes #1548
Proposed changes
Async delegates have been deprecated in .NET Core (see https://github.com/dotnet/corefx/issues/5940) for reasons such as:
For more detailed reasons and migration strategies please refer to https://devblogs.microsoft.com/dotnet/migrating-delegate-begininvoke-calls-for-net-core/
In case of WinForms, async pattern predates the Task-based Asynchronous Pattern and it does not return awaitables.
In order to minimise the change to the public API surface we continue to expose the existing API and just re-route the image loading routine to a
Taskrunner under the covers.Customer Impact
Regression?
Risk
Test methodology
Microsoft Reviewers: Open in CodeFlow