.NET Parallel Programming

All about Async/Await, System.Threading.Tasks, System.Collections.Concurrent, System.Linq, and more…

New Feature? :: Delayed cancellation

 We’re interested in adding support for scheduling cancellation.  For example: // Create a token source that will Cancel() after a delay var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100));// And/or schedule a Cancel() call cts.CancelAfter(TimeSpan.FromMilliseconds(100));We’ve heard from many folks ...

Creating pre-completed Tasks

 We’ve been considering adding support for creating completed Tasks from an existing result.  Here’s a prototypical example of where this could be valuable. void Task<float> ComputeAsync(...) {     if (!resultIsCached)     {         return Task<...