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

  • Home
  • SEARCH
  • 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 1085057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:38:25+00:00 2026-05-16T22:38:25+00:00

i have bunch of question regarding to boost thread ? How to initialize the

  • 0

i have bunch of question regarding to boost thread ?

  1. How to initialize the boost thread ID with the thread constructor?
  2. Why the thread id becomes invalid after called join() function ?
  3. As usual, a class member function is copy to thread internal storage in order to execute the member function but i found out that someone just encapsulates the boost thread in a class.
    What is the purposes for this ?

On the other hands, do we allow to inherit the boost thread ?
Please help.

Thanks.

  • 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-16T22:38:25+00:00Added an answer on May 16, 2026 at 10:38 pm
    1. You can get the ID from a boost::thread object by calling it’s get_id() member function:
    boost::thread t(do_something);
    boost::thread::id tid=t.get_id();
    

    You can get the ID of the current thread by calling boost::this_thread::get_id().

    1. Thread ID values remain valid after a thread exits, unlike the thread IDs for some OS thread libraries.

    2. If you pass in the address of a member function, and the address of an object then you can run a member function on that object on a new thread. You can therefore start threads in a member function, and pass this as the object pointer. This allows the new thread to share data via the data members of the class instance.

      You can derive from boost::thread but it wouldn’t really get you anywhere as there are no virtual functions.

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

Sidebar

Related Questions

Hey everyone, here is the site in question: http://www.myvintagesecret.com/ I have a bunch of
I have a bunch of functions with signatures like: FUNCTION func1 (par1 IN VARCHAR2,
I have a question regarding class design. I want to have a class that
I have a question regarding string modification. Let's assume that we have the following
I have a question regarding Spring Web Flow with JSF: How can I teach
I'm a beginner at C++ and have a question regarding sorting a vector of
This question is related to others I have asked on here, mainly regarding sorting
I have gone through a bunch of question posts, and found one person with
Dumb question. Lets say I have a bunch of person objects with their fields
I have a following question. Suppose I have a bunch of repositories hosted that

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.