Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8185689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:56:12+00:00 2026-06-07T01:56:12+00:00

Threads waiting with a boost::barrier wait() do not get interrupted when boost::thread Interrupt() is

  • 0

Threads waiting with a boost::barrier wait() do not get interrupted when boost::thread Interrupt() is called. e.g.
http://www.justsoftwaresolutions.co.uk/threading/thread-interruption-in-boost-thread-library.html

Is there a good reason for this?

Of course we can manually place a boost::this_thread::interruption_point() to work round it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:56:14+00:00Added an answer on June 7, 2026 at 1:56 am

    Boost interruption points throw exception if interruption flag has been set on current thread and the behaviour is fundamentally different than suspending the thread and calling interruption handler. Neither of locks in boost is an interruption point, which follows the behaviour of pthread locks; when pthread lock is interrupted by signal handler while waiting, it’ll keep waiting when the handler is done. In the same manner, if you mark a boost thread as interrupted, boost::mutex::lock() or boost::barrier::wait() will keep waiting.

    The other thing is, if you allowed barrier::wait() to prematurely return without acquiring the lock, you would have to unregister the current thread from the pool of threads waiting for the barrier before throwing an exception, which would make the implementation more complex. It would also allow for lock/wait methods to return without acquiring the lock, which would also make your code more complicated.

    Generally, I think it’s simply a design choice.

    If you look at methods that are interruption points, you’ll see they’re usually meant to sleep for a longer time (boost::this_thread::sleep(), boost::condition_variable_any::wait()) and their conterparts sleep and pthread_cond_wait are also being terminated by signals. Although an exception here is boost::thread::join(), which is an interruption point, while pthread_join keep waiting after handling a signal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say the broadcasting thread broadcasts while only 3 threads are waiting and the 4th
I'm writing a multi-threaded server using boost::asio (for sockets), boost::thread (for threading), libconfig++ (for
I'm writing an MPI program (Visual Studio 2k8 + MSMPI) that uses Boost::thread to
We were surprised to learn today that threads waiting on a ManualResetEvent continue waiting
If 2 or more threads are waiting on an event, does SetEvent unblock one
Is there any way to check how many threads are waiting for a synchronized
What is the difference between a parked thread and a waiting thread in java
Got a programm with 2 threads. one thread is writing some stuff into the
I'm considering to use C++0x threads in my application instead of Boost threads. However,
#include <iostream> #include <boost/thread.hpp> using std::endl; using std::cout; using namespace boost; mutex running_mutex; struct

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.