From 4e065725f6602fc40bae48954e4affd6243ba658 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 27 Sep 2021 20:36:30 +0900 Subject: [PATCH 1/2] Added automatic threads per ioc mode. (0) --- example/broker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/example/broker.cpp b/example/broker.cpp index f72a6002a..775eeef78 100644 --- a/example/broker.cpp +++ b/example/broker.cpp @@ -10,6 +10,7 @@ #include #include +#include namespace as = boost::asio; @@ -349,8 +350,8 @@ void run_broker(boost::program_options::variables_map const& vm) { return 1; } (); if (threads_per_ioc == 0) { - MQTT_LOG("mqtt_broker", error) << "threads per ioc must be greater than 0"; - return; + threads_per_ioc = std::max(std::size_t(std::thread::hardware_concurrency()), std::size_t(4)); + MQTT_LOG("mqtt_broker", info) << "threads_per_ioc set to auto decide (0). Automatically set to " << threads_per_ioc; } MQTT_LOG("mqtt_broker", info) From bfcc7f3c9213778efbe85612fcfa948da8841857 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 27 Sep 2021 20:37:40 +0900 Subject: [PATCH 2/2] Updated CHANGELOG --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ad8dfc5b..59d0e97fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 12.0.0 -* Added io_context and threads setting options for example broker (#866) +* Improved exampless (#870) +* Fixed example broker's invalid sync connack call (#869) +* Added no CONNACK sending mode to the example broker (#869) +* Added posting code to acceptors (#867) +* Added io_context and threads setting options for example broker (#866, #871) * Fixed moved from object access (#865) * <<<< breaking change >>>> Removed ioc_con() and ioc_accept() (#866) * <<<< breaking change >>>> Unified automatic async/sync choosing flag. (#857, #862) @@ -14,7 +18,7 @@ * Added multi thread support for example broker (#842, #855, #866) * Replaced example broker's API call from sync to async (#842) * Replaced use_certificate_file() with use_certificate_chain_file() to support both server cert and server - intermediate CA cert (#841) -* <<<< breaking change >>>> Added async_force_disconnect(). force_disconnect() is removed from async_client (#840) +* <<<< breaking change >>>> Added async_force_disconnect(). force_disconnect() is removed from async_client (#840, #868) * Added will delay interval support (#839) * Fixed async_handler_t calling timing (#836) * Added BOOST_ASIO_NO_TS_EXECUTORS support (#830)