• <tfoot id='M9i7v'></tfoot>

        <small id='M9i7v'></small><noframes id='M9i7v'>

          <bdo id='M9i7v'></bdo><ul id='M9i7v'></ul>
        <legend id='M9i7v'><style id='M9i7v'><dir id='M9i7v'><q id='M9i7v'></q></dir></style></legend>
      1. <i id='M9i7v'><tr id='M9i7v'><dt id='M9i7v'><q id='M9i7v'><span id='M9i7v'><b id='M9i7v'><form id='M9i7v'><ins id='M9i7v'></ins><ul id='M9i7v'></ul><sub id='M9i7v'></sub></form><legend id='M9i7v'></legend><bdo id='M9i7v'><pre id='M9i7v'><center id='M9i7v'></center></pre></bdo></b><th id='M9i7v'></th></span></q></dt></tr></i><div id='M9i7v'><tfoot id='M9i7v'></tfoot><dl id='M9i7v'><fieldset id='M9i7v'></fieldset></dl></div>

        boost::asio 线程池与 io_service_per_cpu 设计

        时间:2023-07-20
      2. <small id='XIzfH'></small><noframes id='XIzfH'>

        <i id='XIzfH'><tr id='XIzfH'><dt id='XIzfH'><q id='XIzfH'><span id='XIzfH'><b id='XIzfH'><form id='XIzfH'><ins id='XIzfH'></ins><ul id='XIzfH'></ul><sub id='XIzfH'></sub></form><legend id='XIzfH'></legend><bdo id='XIzfH'><pre id='XIzfH'><center id='XIzfH'></center></pre></bdo></b><th id='XIzfH'></th></span></q></dt></tr></i><div id='XIzfH'><tfoot id='XIzfH'></tfoot><dl id='XIzfH'><fieldset id='XIzfH'></fieldset></dl></div>

        <tfoot id='XIzfH'></tfoot><legend id='XIzfH'><style id='XIzfH'><dir id='XIzfH'><q id='XIzfH'></q></dir></style></legend>

              • <bdo id='XIzfH'></bdo><ul id='XIzfH'></ul>

                    <tbody id='XIzfH'></tbody>
                  本文介绍了boost::asio 线程池与 io_service_per_cpu 设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  目前我不确定,我尝试制作高性能服务器,我有一个 6Core CPU,所以如果我使用io_service_per_cpu"设计,我有 6 个 io_service.

                  Currently Im not sure, I try to make a high-performance server, I got a 6Core CPU, so if I would use the "io_service_per_cpu" design, I have 6 io_services.

                  我已经听说线程池设计不是最好的,但我不确定.

                  I already heard that the threadpool design isnt the best one, but Im not sure about that.

                  你有什么知识?有人已经对每个人进行了压力测试,还是其他什么?

                  What knowledge do you have? Someone already made a Stress test with each, or something else?

                  推荐答案

                  根据我的经验,按照以下顺序进行异步应用程序设计要容易得多:

                  In my experience it is vastly easier to approach asynchronous application design with the following order:

                  1. 单线程和一个io_service
                  2. 多个线程,每个线程从单个 io_service 调用 io_service::run().使用 strands 作为处理程序需要访问共享数据结构.
                  3. io_service 每个 cpu
                  1. single thread and a single io_service
                  2. multiple threads, each invoking io_service::run() from a single io_service. Use strands for handlers that require access to shared data structures.
                  3. io_service per cpu

                  在对您的应用程序进行概要分析之后,应该考虑在这些设计中的每一个之间进行更改.请注意,仅 HTTP Server 2 示例展示了如何使用每个 CPU 的 io_service,它没有告诉你何时或为什么使用这样的设计.

                  The motivation for changing between each of these designs should be done after profiling your application. Note that the HTTP Server 2 example only shows how to use an io_service per CPU, it does not show you when or why to use such a design.

                  这篇关于boost::asio 线程池与 io_service_per_cpu 设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:C++ 模板实例化:避免长切换 下一篇:在 Windows 上使用 Boost_USE_STATIC_LIB OFF 链接 boost 库

                  相关文章

                    <i id='svTuv'><tr id='svTuv'><dt id='svTuv'><q id='svTuv'><span id='svTuv'><b id='svTuv'><form id='svTuv'><ins id='svTuv'></ins><ul id='svTuv'></ul><sub id='svTuv'></sub></form><legend id='svTuv'></legend><bdo id='svTuv'><pre id='svTuv'><center id='svTuv'></center></pre></bdo></b><th id='svTuv'></th></span></q></dt></tr></i><div id='svTuv'><tfoot id='svTuv'></tfoot><dl id='svTuv'><fieldset id='svTuv'></fieldset></dl></div>
                    • <bdo id='svTuv'></bdo><ul id='svTuv'></ul>
                    <tfoot id='svTuv'></tfoot>

                    <small id='svTuv'></small><noframes id='svTuv'>

                    <legend id='svTuv'><style id='svTuv'><dir id='svTuv'><q id='svTuv'></q></dir></style></legend>