(janardhan.guptha@efi.com) wrote:
Hi, i working on an application using boost::thread. The application cretaes a thread, then put in wait state.
Do you mean, you are waiting on a condition variable?
Based on the user input i want the thread eitjer to move it to run state or cancel the thread.
When the condition is fullfilled, your thread will run. If the condition signals cancelation time you should exit your thread.
As i am newbie to boost thread, i couldn't find any documentation or working example that satisfies my requiremnt. So someone can help me out??
Thread cancellation is a complicated topic and is not yet covered by boost thread. That does not mean, you cannot use it. You should try to design your application in a way that can do without cancellation support. Some even think foreign cancellation of threads is bad design. If you are new to threading however I would recommend to read something about the topic beforehand. Getting a book about the pthreads library (a C library) might be very valuable, since the boost thread uses quite a couple of ideas from it. Regards Roland