Search code examples
c++multithreadingboostboost-thread

One thread in thread_group is not interrupted


I am using boost::thread_group, after sending signal I catch it and sending interrupt_all() on thread_group. Nearly always there is one(!) thread which is not interrupted although he goes through interruption points. I thought that maybe using dual core processor can cause it. However even if I set to launch all threads on one core this problem occurs.

What can be a reason?

Creating my own (global) interruption_point is only one solution which comes to my mind.


Solution

  • I need to say thread interruption has never been a "reliable" feature on almost all platforms. You'd better to re-design if your program depends on it.