Tag Info

New answers tagged

0

In the Readiness Model memory consumption is proportional to the amount of data unconsumed by the application. In the Completion Model the memory consumption is proportional to the amount of outstanding socket calls. If there are many sockets that are mostly idle then the Readiness Model consumes less memory. There is an easy fix for the Completion Model: ...


0

Should I provide these methods or should I let people implement their own? I'm trying to find the post (I think it was Stephen Cleary on SO), but one of the answers had made the point that he preferred to make his operations synchronous and let the client decide if they want to call them asynchronously or not. It stuck with me because it was Stephen ...


3

You could rewrite your code this way in a pure async/await paradigm. private async void button1_Click(object sender, EventArgs e) { int r = await longRunningWork(); textBox1.Text += (r.ToString()); } private async Task<int> longRunningWork() { await Task.Delay(15000); return (new Random()).Next(10); ...



Top 50 recent answers are included