How to measure performance of awaiting asynchronous operations?

后端 未结 2 1219
清酒与你
清酒与你 2020-12-20 17:59

I have a Windows Service that reads from multiple MessageQueue instances. Those messagequeues all run their own Task for reading messages. Normally

2条回答
  •  不知归路
    2020-12-20 18:37

    You're still running each task in its own thread from the thread pool - as you're using the default task scheduler. If you want to see performance imporvement, you'll need to make sure several tasks are performed on the same thread.

    Also, with 20 parallel tasks, you're probably not going to see any difference. Try it with 2,000 tasks.

提交回复
热议问题