What is the difference between SynchronizationContext.Send and SynchronizationContext.Post?

前端 未结 1 1148
走了就别回头了
走了就别回头了 2020-12-13 06:48

Thanks to Jeremy Miller\'s good work in Functional Programming For Everyday .NET Development, I have a working command executor that does everything I want it to (do heavy l

相关标签:
1条回答
  • 2020-12-13 07:30

    Send - synchronous: wait for answer (or action completed)

    Post - asynchronous: drop off and continue

    So your example uses the correct methods at the right moments. There is no need to halt the for-loop until the progress update is complete (on the contrary).
    And Execute does want to wait for the Action to complete, otherwise the exception handling has no purpose.

    0 讨论(0)
提交回复
热议问题