Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3494546
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:01:06+00:00 2026-05-18T12:01:06+00:00

In example 3 of the HTTP server (boost 2.44), the IO service is created

  • 0

In example 3 of the HTTP server (boost 2.44), the IO service is created without a thread count hint. Under Windows, one normally passes the thread count to CreateIoCompletionPort(). boost:asio has an IO Service ctor that takes the thread count, but that ctor is not used in this example. And the thread count is known.

My question is: is there a reason to create the IO Service without the thread count? Does boost:asio assume one would never create more threads than one per core? Note if the thread count passed to CreateIoCompletionPort() is zero, the system will allow one thread per core concurrently running threads.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T12:01:06+00:00Added an answer on May 18, 2026 at 12:01 pm

    When you call the parameter-less constructor on io_service, the call to CreateIoCompletionPort winds up using a thread count of 0xffffffff in the code here:

    void win_iocp_io_service::init(size_t concurrency_hint)
    {
      iocp_.handle = ::CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0,
          static_cast<DWORD>((std::min<size_t>)(concurrency_hint, DWORD(~0))));
      if (!iocp_.handle)
      {
        DWORD last_error = ::GetLastError();
        boost::system::error_code ec(last_error,
            boost::asio::error::get_system_category());
        boost::asio::detail::throw_error(ec, "iocp");
      }
    }
    

    Not sure how Windows interprets this but the call works OK, so I assume this is the same as using 0. I guess the assumption is that the OS knows best?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm using this example implementation found at http://tangentsoft.net/wskfaq/examples/basics/select-server.html This is doing most of what
Query parameters : http://example.com/apples?order=random&color=blue Matrix parameters : http://example.com/apples;order=random;color=blue When should one use query parameters
I'm looking for the best way to modify the Boost Asio HTTP Server 3
I'm trying to build an example of boost::asio http://www.boost.org/doc/libs/1_43_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp but without any luck. System:
I have some sub-applications in my site, for example: http://server/app/subapp1 http://server/app/subapp2 How can I
I have a RSS feed generated by my server ( for example : http://www.seek-team.com/en/teams/counter-strike-source/feed/
Here's just this example: http://www.xyzws.com/Javafaq/how-to-use-httpurlconnection-post-data-to-web-server/139 Why it feels so strange?
I'm writing a cross-platform server program in C++ using Boost.Asio. Following the HTTP Server
I serve content from a subdirectory on my web server, for example: http://www.myserver.com/subtree I
For example: http://stackoverflow.com/questions/396164/exposing-database-ids-security-risk and http://stackoverflow.com/questions/396164/blah-blah loads the same question. (I guess this is DB

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.