boost-thread

how to use threading in c++ which points to another class

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 ...

Example of how to use boost upgradeable mutexes

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...

Using exceptions within a boost::thread thread

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...

How can I achieve something similar to a semaphore using boost in c++?

I noticed that boost does not seem to support semaphores. What's the easiest way to achieve a similar effect? ...

What’s the best way to delete boost::thread object right after its work is complete?

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 ...

Looking for a graphical explanation of boost threading.

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...

C++ Thread Pool

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. ...

boost::thread and template functions

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 ...