Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Anders Sjögren

Anders Sjögren Anders_​Sjogren

Niner since 2011

  • The zen of async: Best practices for best performance

    Hi Stephen,

    regarding the design of throwing exception in the finalizer thread on unobserved exceptions, this may well make sense but since it is potentially really dangerous, it needs to be much better highlighted and formalised in the MSDN documentation for the Task class and in the Task parallelism section.

    I think that a complex enough area would warrant a formal (check-)list of rules to adhere to, e.g..:

    • Tasks must always be observed. If a task is faulted and that is not observed, an exception will be thrown by the finalizer thread at a potentially much later point in time. For more details see http:/....
    • Tasks are disposables and thus needs to be disposed. (OR) Even though Tasks are disposables, they don't need to be disposed and doing so is a null operation.
    • ...

    Thanks

     

  • The zen of async: Best practices for best performance

    Hi Stephen.

    Thanks for the interesting and in depth talk.

    One question: How can one cache Tasks when they are Disposable? If the first caller disposes the resulting task (which is also cached), the second caller will get the same disposed task as result?

    On the topic of Disposing Tasks. That is seldom or never done in examples, even though Tasks implement the IDisposable interface. I couldn't find details on it in the MSDN documentation for the Task class and in the Task parallelism section either. Should one make sure to always dispose of received tasks, or is it unnecessary, and if so why are they IDisposable? If it is necessary, why is that seldom done in examples?

    Cheers