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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:01:55+00:00 2026-06-18T10:01:55+00:00

I am trying to capsulate a thread as it is shown here: http://antonym.org/2009/05/threading-with-boost—part-i-creating-threads.html But

  • 0

I am trying to capsulate a thread as it is shown here:
http://antonym.org/2009/05/threading-with-boost—part-i-creating-threads.html

But somehow I can’t even compile my program.. This:

/**
 *
 */
void AcceptConnectionThread::start(int param)
{
  m_thread = boost::thread(&AcceptConnectionThread::AcceptConnectionThreadRun, this, 0);
}


/**
 *
 */
int AcceptConnectionThread::AcceptConnectionThreadRun()
{
  return 0;
}

just gives me this:

Description Resource    Path    Location    Type   required from `boost::_bi::bind_t<R, F, L>::result_type boost::_bi::bind_t<R, F, L>::operator()() [with R = void; F = int (*)(); L = boost::_bi::list2<boost::_bi::value<AcceptConnectionThread*>, boost::_bi::value<int> >; boost::_bi::bind_t<R, F, L>::result_type = void]’   ServerNetwork       line 20, external location: /usr/include/boost/bind/bind_template.hpp   C/C++ Problem
Description Resource    Path    Location    Type   required from ‘void boost::detail::thread_data<F>::run() [with F = boost::_bi::bind_t<void, int (*)(), boost::_bi::list2<boost::_bi::value<AcceptConnectionThread*>, boost::_bi::value<int> > >]’    ServerNetwork       line 62, external location: /usr/include/boost/thread/detail/thread.hpp C/C++ Problem
Description Resource    Path    Location    Type too many arguments to function ServerNetwork       line 313, external location: /usr/include/boost/bind/bind.hpp   C/C++ Problem

This is the template-constructor that is used:

template <class F,class A1,class A2>
thread(F f,A1 a1,A2 a2):
    thread_info(make_thread_info(boost::bind(boost::type<void>(),f,a1,a2)))
{
    start_thread();
}

I really do not have any idea what the problem is..

EDIT:

Anyway, it works with this.. but this way I can’t pass any parameter..

/**
 *
 */
void AcceptConnectionThread::start(int param)
{
  m_thread = boost::thread(&AcceptConnectionThread::AcceptConnectionThreadRun);
}
  • 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-18T10:01:56+00:00Added an answer on June 18, 2026 at 10:01 am

    use boost::bind

    
    
        /**
         *
         */
        void AcceptConnectionThread::start(int param)
        {
          int para_to_pass = 0;
          m_thread = boost::thread( boost::bind(&AcceptConnectionThread::AcceptConnectionThreadRun, this, para_to_pass));
        }
    
    
        /**
         *
         */
        int AcceptConnectionThread::AcceptConnectionThreadRun(int para)
        {
          // use para
          return 0;
        }
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

am trying to calculate mean and variance using 3X3 window over image(hXw) in opencv...here
i have thread pool that create threads each thread worker calculate some work and
Im trying to implement multi-threading in my application that makes a lot of float
Ok so what I am trying to do here is to have a method
I'm trying to implement a SurfaceView , calling its onDraw() method from a Thread
I am trying to get my head around creating a non-blocking piece of heavy
I have 16 threads that calculate the hash of a key. I'm trying to
I'm trying to do some image processing on iPhone. I'm using http://developer.apple.com/library/ios/#qa/qa2010/qa1702.html to capture
I'm stuck with trying to capsulate 3 divs inside one wrapping div. So far
I'm trying to replicate an answer given in a previous thread: How to calculate

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.