One of the advantages of async code is it does not block threads. For example, in a UI application, writing async code will allow the UI thread not to be blocked by long operations. However, in the current implementation, an async pipeline will block the current thread.
See https://github.com/valentiniliescu/TestPipelinesAsync for an WinForms example. There are 3 buttons:
- one that does a synchronous long operation
- one that does a asynchronous long operation
- one that does a long operation in an async pipeline
You can check that the async pipeline behaves more like the synchronous click - the UI thread hangs till the operation finishes (try to click on the text boxes, the UI is frozen).
One of the advantages of async code is it does not block threads. For example, in a UI application, writing async code will allow the UI thread not to be blocked by long operations. However, in the current implementation, an async pipeline will block the current thread.
See https://github.com/valentiniliescu/TestPipelinesAsync for an WinForms example. There are 3 buttons:
You can check that the async pipeline behaves more like the synchronous click - the UI thread hangs till the operation finishes (try to click on the text boxes, the UI is frozen).