Simple consoles and async

When presenting, I like to demonstrate simple concepts in console apps because they don’t have any other baggage around them. This is a problem with async code though because you cannot have an async Main method. Entry point methods cannot be marked async. To do async work here, though, you don’t have to explicitly start…

0

Cancellable “awaiting” on .NET events continued

Compose, compose, compose. Reuse, reuse, reuse. In the last post on cancellable “awaiting” on .NET events, I was so busy focusing on the wrapping the click event in order to get a smooth async control flow for the caller, I neglected to do the same inside the click event wrapper code. The framework team already…

3

Cancellable “awaiting” on .NET events

My last couple of posts have been inspired by await-ing things (see Lucian’s list) which allow you to use Tasks and the new C# async features to write synchronous looking expressive code around things that are not based on threads. There was one bit that was bothering me in the last post about drag and…

0

Drag and Drop with Tasks & Async

Lucian has an excellent series on turning things into Tasks so that you can can be compose them and await them. The Drag and Drop one caught my eye because it is a similar example to the common Reactive Extension demo of the same thing. Drag and Drop is interesting because it is started by…

0

Tasks are not Threads

One of the common misconceptions I’ve encountered when developers first start using the Task Parallel Library is that they think Tasks are just fancy threads. This is easy to assume because in a common case, calling Task.Run(…), it actually does run the Task activity on a thread from the thread pool. But as Stephen Toub…

2