[Interprocess] How to interrupt interprocess_condition::wait()?
I had a simple concurrent queue that was working fine shuffling data between threads. Now I want to use it between processes. I switched out the boost::condition_variable for a boost::interprocess::interprocess_condition. The queue funcitons normally, except that I can't interrupt the thread waiting on the queue. Previously I simply called boost::thread::interrupt() and the thread would die (with the interrupt exception I assume). But interprocess_condition::wait() doesn't seem to care about the interrupt. Am I missing something? Do I need to use the interprocess_condition since the queue is in shared memory? Or can I go back to using the boost::condition_variable? -- View this message in context: http://boost.2283326.n4.nabble.com/Interprocess-How-to-interrupt-interproces... Sent from the Boost - Users mailing list archive at Nabble.com.
El 22/03/2012 22:06, wright_left escribió:
I had a simple concurrent queue that was working fine shuffling data between threads. Now I want to use it between processes. I switched out the boost::condition_variable for a boost::interprocess::interprocess_condition. The queue funcitons normally, except that I can't interrupt the thread waiting on the queue. Previously I simply called boost::thread::interrupt() and the thread would die (with the interrupt exception I assume). But interprocess_condition::wait() doesn't seem to care about the interrupt.
Interprocess does not support interruption as it is not trivial to implement. Standard C++ condition variables don't require interruption, so it is not uncommon to miss those in synchronization primitives. Any help is appreciated to add this support to Interprocess ;-) Best, Ion
participants (2)
-
Ion Gaztañaga
-
wright_left