Last time, we brought ThreadSwitcher.ResumeForegroundAsync and ThreadSwitcher.ResumeBackgroundAsync to C# for UWP. Today, we'll do the same for WPF and Windows Forms. It'll be easier the second and third times through because we already learned how to structure the implementation. It's just the minor details that...
Last time, we developed a RunTaskAsync method to try to make it easier to switch threads in a task, but we saw that while it simplified some operations, it was still cumbersome because of the difficulty of sharing state between the main method and the async lambdas that it kicked off to other threads. Let's fix that by stealing an ...
As we saw last time, The the CoreDispatcher::RunAsync and ThreadPool::RunAsync methods complete when the delegate returns, which is not the same as when the delegate completes. How can you wait until the delegate completes? We'll have to track the delegate completion ourselves. One way is to signal the completion with a ...
The CoreDispatcher::RunAsync and ThreadPool::RunAsync methods take a delegate and schedule it to be invoked on the dispatcher thread or on a thread pool thread. These methods return an IAsyncAction, but when does that action complete? When dealing with asynchronous methods, there are two ways of talking about the ...
The Visual Studio toolchain comes with a tool called nmake. It processes files in roughly the same way as the traditional Unix make tool. Why is it called nmake instead of just make? Rewind back to the late 1980's. The Microsoft languages toolchain¹ included a make program which we will generously describe as vaguely inspired by the Unix...
This upcoming weekend, the Vintage Computer Festival Pacific Northwest 2019 will take place at the Living Computers Museum+Labs in Seattle. The festival is included with admission to the museum. ($18 general admission.) "Team emulators" Darek Mihocka, Danny Miller, and Steven Noonan will be there with an exhibit titled 40 years of Atari on ...
Last time, we wrote a helper function for converting an awaitable into a winrt::fire_and_forget, as well as another helper function that takes a lambda that returns an awaitable, and which invokes the lambmda as a winrt::fire_and_forget. After I wrote the two functions, I wondered if I could unify them. Mostly because I wanted to use the same...
Last time, we looked at how to mark a coroutine as fire-and-forget, meaning that the caller does not get any information about when the coroutine completes. This is fine as far as it goes, but it may not be what you want. Fire-and-forget-ness is frequently a property of the call site, not the function itself. A particular coroutine could be ...
C++/WinRT provides a handy helper class called winrt::fire_and_forget. It lets you specify that nobody is going to observe the result of the coroutine. This is handy because it lets you tell the compiler that the lack of observation is intentional, so it won't generate a warning. The OnClick function calls DoSomething, which does a bunch...
A customer reported that their installer creates a shortcut on the Start menu called Uninstall Contoso Deluxe, but a few seconds after their installer completes, the Uninstall Contoso Deluxe icon disappears from the Start menu. The main Contoso Deluxe shortcut is still there. What's going on? The uninstaller shortcut is removed from the Start...