hello,
i need to use the function in another class file as thread
int main()
{
master t;
boost::thread t1(boost::bind(t.start, "exampl"));
t1.join();
}
i have an class master and a function start ..i need to pass an value to it and run
i have used this in same class it works fine...can any one tell me where i am wrong
...
I have a multithreaded server application that needs mutex locks over some shared memory.
The shared memory are basically sTL maps etc.
Much of the time I'm just reading from the map.
But, I also need to occasionally add to it.
e.g.
typedef std::map MessageMap;
MessageMap msgmap;
boost:shared_mutex access_;
void ProcessMe...
Hello,
I began to play around with boost::threads, but I'm kind of stuck with this problem:
I don't understand why this program crashes as soon as the exception is thrown, because I try to catch it within the thread. I thought that it would be possible to work with exceptions as long as the handling happens in the same thread as the t...
I noticed that boost does not seem to support semaphores. What's the easiest way to achieve a similar effect?
...
I create boost::thread object with a new operator and continue without waiting this thread to finish its work:
void do_work()
{
// perform some i/o work
}
boost::thread *thread = new boost::thread(&do_work);
I guess, it’s necessary to delete thread when the work is done. What’s the best way to this without explicitly waiting for ...
As I read into threading, I'm starting to see a lot of really helpful diagrams that look like these:
I was wondering if any of you know of a repository of such images that describe the functionality of the boost threading objects, idioms, potential pitfalls, etc.
The most helpful diagram that I can envision would look something like...
What is a good open source implementation of a thread pool for C++ to use in production code (something like boost)?
Please provide either your own example code or a link to example code usage.
...
I am trying to run a template function on a separate thread but IntelliSense (VC++ 2010 Express) keeps giving me the error:
"Error: no instance of constructor "boost::thread::thread" matches the argument list"
and if I try to compile I get this error:
"error C2661: 'boost::thread::thread' : no overloaded function takes 5 arguments"
The ...