C# first class continuation via C++ interop or some other way?

前端 未结 5 2028
半阙折子戏
半阙折子戏 2021-02-02 08:11

We have a very high performance multitasking, near real-time C# application. This performance was achieved primarily by implementing cooperative multitasking in-house with a ho

5条回答
  •  再見小時候
    2021-02-02 08:54

    The solution to your problem is to use lock-free algorithms allowing for system wide progress of at least one task. You need to use inline assembler that is CPU dependent to make sure that you atomic CAS (compare-and-swap). Wikipedia has an article as well as patterns described the the book by Douglas Schmidt called "Pattern-Oriented Software Architecture, Patterns for Concurrent and Networked Objects". It is not immediately clear to me how you will do that under the dotnet framework.

    Other way of solving your problem is using the publish-subscriber pattern or possible thread pools.

    Hope this was helpful?

提交回复
热议问题