Asynchronous Delegates Vs Thread/ThreadPool?

前端 未结 8 2177
醉梦人生
醉梦人生 2020-12-22 23:57

I need to execute 3 parallel tasks and after completion of each task they should call the same function which prints out the results.

I don\'t understand in .net why

8条回答
  •  自闭症患者
    2020-12-23 00:47

    This is a long forgotten thread, but something that wasn't mentioned here at all was that there are two type of work, Compute and I/O bound.

    In the case of Compute bound work, this is executed in a separate thread (if you use BackgroundWorker or Begin/End pattern, this comes from the Thread pool; or, a custom thread if you decided to create your own thread).

    I/O bound on the other hand is executed in I/O ports (hardware support), and do not require a thread; File access and Network sockets are two examples of I/O bound tasks.

提交回复
热议问题