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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:34:45+00:00 2026-06-14T09:34:45+00:00

I have a code base that is using many instances of detached boost::thread as

  • 0

I have a code base that is using many instances of detached boost::thread as folllows

boost::thread th( boost::bind(&myFunc,var1, var2 ));

Can I simply do a search replace and start using std::thread?

Do I need to replace boost::bind with std::bind too or that is unnecessary?

( I found I could do search replace boost::shared_ptr with std::shared_ptr and boost::scoped_ptr with std::unique_ptr so far without any issues.

My platform is Visual Studio 11 on Windows 7.

  • 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-06-14T09:34:46+00:00Added an answer on June 14, 2026 at 9:34 am

    Can I simply do a search replace and start using std::thread?

    The current version of boost::thread has a few features that aren’t in std::thread:

    • join with timeout
    • thread attributes
    • interruption
    • yield() and sleep() (deprecated)

    See the boost documentation, where they are labelled EXTENSION. If you’re not using any of those, then it should be a direct replacement.

    As mentioned in the comments, older versions of boost::thread had a different behaviour on destruction. They would detach the thread if it was still joinable; std::thread and the current boost::thread call std::terminate instead.

    Do I need to replace boost::bind with std::bind too or that is unnecessary?

    That’s not necessary; thread can be given any callable type. It’s also not necessary to use bind at all, since it has a variadic constructor:

    std::thread th(&myFunc, var1, var2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a code base that has been used as an ASP.Net web application.
I have a code-base that I'm looking to split up and add to by
I have a code base that deals with simulation of certain data. It involves
is there any development environments that allow you to have one code base that
I have an existing code base that is not packaged at all. The code
In my code base I find that two modules have structures with the same
I have this program that should execute a piece of code base on the
I have a piece of code that generates a class, Id3v1Tag, using a file
I am using the Entity Framework Code First in C# and I have many
I have a project that is just using Android 1.5 for programming, but with

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.