On WP7, I get this output:
Notice that, on WP7, the entire DoAThingAsync() function executes before control returns to Update(), but on Windows, the expected behavior (control returning to Update() before the async work finishes.
It seems that using Stream.BeginRead() (which didn't used to be available on WP7, I'm assuming it was made available with the Async CTP) works, and the callback comes from the main thread, so perhaps it's using an async task under the hood?
If using BeginRead()/EndRead() solves my problem, then great. But I'd still like to know why await doesn't seem to do the right thing on WP7.
31 martie 2012 17:18
Have a suggestion to improve Forums?
Visit our UserVoice Page to submit and vote on ideas!