Non-threaded alternative to waiting on a condition. (Edit: Proactor pattern with boost.asio?)

不羁岁月 提交于 2019-12-04 06:31:35

I guess what you are looking for is the reactor pattern. This is where most of the activities do not take too much time and they are doing co-operative multitasking. See node.js for a JavaScript implementation of the idea, but in C++ the ACE library provides this concept out-of-the-box allowing multiple threads based on the number of cores in the system.

These libraries all depend on some OS APIs that support non-blocking IO on disks, network, etc. When you are not waiting for the OS, but another message source in your app, they provide you with the tools for that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!