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

前端 未结 5 2037
半阙折子戏
半阙折子戏 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:52

    There is the C# 5 CTP, which performs a continuation-passing-style transformation over methods declared with the new async keyword, and continuation-passing based calls when using the await keyword.

    This is not actually a new CLR feature but rather a set of directives for the compiler to perform the CPS transformation over your code and a handful of library routines for manipulating and scheduling continuations. Activation records for async methods are placed on the heap instead of the stack, so they're not tied to a specific thread.

提交回复
热议问题