C# Async - How does it work?

后端 未结 3 1033
走了就别回头了
走了就别回头了 2020-11-29 00:30

Microsoft announced the Visual Studio Async CTP today (October 28, 2010) that introduces the async and await keywords into C#/VB for asynchronous m

3条回答
  •  醉梦人生
    2020-11-29 01:01

    How can I have an operation executed in parallel on the same thread?

    You can't. Asynchrony is not "parallelism" or "concurrency". Asynchrony might be implemented with parallelism, or it might not be. It might be implemented by breaking up the work into small chunks, putting each chunk of work on a queue, and then executing each chunk of work whenever the thread happens to be not doing anything else.

    I've got a whole series of articles on my blog about how all this stuff works; the one directly germane to this question will probably go up Thursday of next week. Watch

    http://blogs.msdn.com/b/ericlippert/archive/tags/async/

    for details.

提交回复
热议问题