Threads vs. Async

后端 未结 6 1521
盖世英雄少女心
盖世英雄少女心 2020-12-02 05:39

I have been reading up on the threaded model of programming versus the asynchronous model from this really good article. http://krondo.com/blog/?p=1209

However, the

6条回答
  •  生来不讨喜
    2020-12-02 06:02

    Async I/O means there is already a thread in the driver that does the job, so you are duplicating functionality and incurring some overhead. On the other hand, often it is not documented how exactly the driver thread behaves, and in complex scenarios, when you want to control timeout/cancellation/start/stop behaviour, synchronization with other threads, it makes sense to implement your own thread. It is also sometimes easier to reason in sync terms.

提交回复
热议问题