Boost logo

Boost Users :

Subject: Re: [Boost-users] [thread] Is a call to interrupt_all blocking?
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2010-01-26 05:52:08


Sachin Garg <schngrg_at_[hidden]> writes:

> Does a call to interrupt_all blocks the calling thread, waiting for all threads
> to be interrupted? Or is it supposed to return immediately and let the threads
> hit their interruption points later?

interrupt_all is not blocking. However, there is currently a bug in
interruption on pthreads which means threads can miss interruptions if
they get a spurious condition variable wake at the wrong time. Since
interruption causes spurious wakes for other threads waiting on the same
cv this is particularly a problem for interrupt_all.

Anthony

-- 
Author of C++ Concurrency in Action     http://www.stdthread.co.uk/book/
just::thread C++0x thread library             http://www.stdthread.co.uk
Just Software Solutions Ltd       http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net