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 6382405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:31:04+00:00 2026-05-25T02:31:04+00:00

Motivation: reason why I’m considering it is that my genius project manager thinks that

  • 0

Motivation: reason why I’m considering it is that my genius project manager thinks that boost is another dependency and that it is horrible because “you depend on it”(I tried explaining the quality of boost, then gave up after some time 🙁 ). Smaller reason why I would like to do it is that I would like to learn c++11 features, because people will start writing code in it.
So:

  1. Is there a 1:1 mapping between #include<thread> #include<mutex>and
    boost equivalents?
  2. Would you consider a good idea to replace boost stuff with c++11
    stuff. My usage is primitive, but are there examples when std doesnt
    offer what boost does? Or (blasphemy) vice versa?

P.S.
I use GCC so headers are there.

  • 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-25T02:31:05+00:00Added an answer on May 25, 2026 at 2:31 am

    There are several differences between Boost.Thread and the C++11 standard thread library:

    • Boost supports thread cancellation, C++11 threads do not
    • C++11 supports std::async, but Boost does not
    • Boost has a boost::shared_mutex for multiple-reader/single-writer locking. The analogous std::shared_timed_mutex is available only since C++14 (N3891), while std::shared_mutex is available only since C++17 (N4508).
    • C++11 timeouts are different to Boost timeouts (though this should soon change now Boost.Chrono has been accepted).
    • Some of the names are different (e.g. boost::unique_future vs std::future)
    • The argument-passing semantics of std::thread are different to boost::thread — Boost uses boost::bind, which requires copyable arguments. std::thread allows move-only types such as std::unique_ptr to be passed as arguments. Due to the use of boost::bind, the semantics of placeholders such as _1 in nested bind expressions can be different too.
    • If you don’t explicitly call join() or detach() then the boost::thread destructor and assignment operator will call detach() on the thread object being destroyed/assigned to. With a C++11 std::thread object, this will result in a call to std::terminate() and abort the application.

    To clarify the point about move-only parameters, the following is valid C++11, and transfers the ownership of the int from the temporary std::unique_ptr to the parameter of f1 when the new thread is started. However, if you use boost::thread then it won’t work, as it uses boost::bind internally, and std::unique_ptr cannot be copied. There is also a bug in the C++11 thread library provided with GCC that prevents this working, as it uses std::bind in the implementation there too.

    void f1(std::unique_ptr<int>);
    std::thread t1(f1,std::unique_ptr<int>(new int(42)));
    

    If you are using Boost then you can probably switch to C++11 threads relatively painlessly if your compiler supports it (e.g. recent versions of GCC on linux have a mostly-complete implementation of the C++11 thread library available in -std=c++0x mode).

    If your compiler doesn’t support C++11 threads then you may be able to get a third-party implementation such as Just::Thread, but this is still a dependency.

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

Sidebar

Related Questions

motivation: I would like to create a utility class so that instead of having
My motivation for chaining my class constructors here is so that I have a
motivation for this is that (rarely)I have a need to know that the input
My main motivation for trying to do this is to get Javascript that is
Update: I deleted my motivation because it seems to distract readers. This is not
Motivation Imagine a huffman compressed file that gets downloaded partially, like in P2P software,
The motivation for this idea is that browser ad requests are often painfully slow
I'm considering a functional language that will play well with my environment of C/Objective-C
Motivation : My EF4.1 DbContext is saving Entities in the wrong order Reason :
Motivation — I had a new version of my Cocoa application ready that worked

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.