Sunday, September 1, 2013

Using Task.Run() without Lamda

The fact that this is a C# forum does not prevent us from using the wider concept of asynchrony as it existed long before the async/await keywords were introduced.


Usually, these concepts are defined to have the following meanings:



  • Parallelism = Multiple threads executing simultaneously

  • Concurrency = Multiple threads

  • Asynchrony = Non-blocking




Concurreny (multiple threads) is one way to implement asynchrony. The async/await keywords are another.


In fact, the MSDN documentation calls the new approach "async programming" to distinguish it from traditional techniques for writing asynchronous applications.


As for naming conventions, the documentation merely states that "Async" should be appended to the names of methods that have an async modifier. It does not say that "Async" name suffix should be reserved only for those methods.


Besides, the "Async" naming convention for non-blocking methods (regardless of implementation) has existed in the .NET Framework at least since version 2.0, far longer than the async/await keywords.


"LOL".




Marcus Björklund


No comments:

Post a Comment