• July 2, 2015 | Task.Run, Async/Await, TaskCreationOptions, | comments | Edit
  • LongRunning Is Useless For Task.Run With Async/Await
  • Back in the olden days of .NET 4.0 we didn’t have Task.Run. All we had to start a task was the complicated Task.Factory.StartNew. Among its parameters there’s a TaskCreationOptions often used to specify TaskCreationOptions.LongRunning. That flag gives TPL a hint that the task you’re about to execute will be longer than usual.

    Nowadays with .NET 4.5 and above we mostly use the simpler and safer Task.Run but it isn’t uncommon to wonder how do you pass TaskCreationOptions.LongRunning as a parameter like we used to do with Task.Factory.StartNew.

  • May 16, 2015 | Async/Await, Bugs | comments | Edit
  • LogicalOperationStack Is Broken With Async/Await
  • Trace.CorrelationManager.LogicalOperationStack enables having nested logical operation identifiers where the most common case is logging (NDC). Evidently it doesn’t work with async/await.