微软官方文档介绍:
ValueTask<TResult> Struct
ValueTask Struct
为什么我们需要使用ValueTask,可以参考下面几篇文章:
Why would one use Task<T> over ValueTask<T> in C#?
Understanding the Whys, Whats, and Whens of ValueTask
关于ValueTask,有几个使用上的限制,如果不注意会造成程序出现错误:
ValueTask Restrictions
C# ValueTask相关文章(链接)
原文:https://www.cnblogs.com/OpenCoder/p/13348050.html