How to handle code that is synchronous on one platform but async on another
问题 In writing my Xamarin-based cross-platform C# app, a situation I encounter fairly often is code that is synchronous on one platform but async on another. For example, file access is synchronous on iOS, Android, and Mac, but async on Windows. This leads to some tricky issues. First of all, on a pure coding level, the compiler wants a method to be either async or not. But it's worse than that. For example, if the iOS UI thread discovers that it needs to load a small file, and does so,