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 546049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:49:34+00:00 2026-05-13T10:49:34+00:00

I read at multiple places that Boost.Signals is not threadsafe but I haven’t found

  • 0

I read at multiple places that Boost.Signals is not threadsafe but I haven’t found much more details about it. This simple quote doesn’t say really that much. Most applications nowadays have threads – even if they try to be single threaded, some of their libraries may use threads (for example libsdl).

I guess the implementation doesn’t have problems with other threads not accessing the slot. So it is at least threadsafe in this sense.

But what exactly works and what would not work? Would it work to use it from multiple threads as long as I don’t ever access it at the same time? I.e. if I build my own mutexes around the slot?

Or am I forced to use the slot only in that thread where I created it? Or where I used it for the first time?

  • 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-05-13T10:49:34+00:00Added an answer on May 13, 2026 at 10:49 am

    I don’t think it’s too clear either, and one of the library reviewers said here:

    I also don’t liked the fact that only three times the word ‘thread’ was named.
    Boost.signals2 wants to be a ‘thread safe signals’ library. Therefore some more
    details and especially more examples concerning on that area should be given to
    the user.

    One way of figuring it out is to go to the source and see what they’re using _mutex / lock() to protect. Then just imagine what would happen if those calls weren’t there. 🙂

    From what I can gather, it’s ensuring simple things like “if one thread is doing connects or disconnects, that won’t cause a different thread which is iterating through the slots attached to those signals to crash”. Kind of like how using a thread-safe version of the C runtime library assures that if two threads make valid calls to printf at the same time then there won’t be a crash. (Not to say the output you’ll get will make any sense—you’re still responsible for the higher order semantics.)

    It doesn’t seem to be like Qt, in which the thread a certain slot’s code gets run on is based on the target slot’s “thread affinity” (which means emitting a signal can trigger slots on many different threads to run in parallel.) But I guess not supporting that is why the boost::signal “combiners” can do things like this.

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

Sidebar

Related Questions

I've read in several places that a C struct can safely be defined multiple
I read in multiple places that the default buffer size for a pipe is
I am learning GWT and i have read at multiple places that using MVP
I have read it here : CodeProject and some other places that there should
I have read multiple articles about why singletons are bad. I know it has
I want to read multiple RSS feeds using jQuery. I'm trying to write a
my project need to read multiple web pages at a time(eg: for a particular
I am trying to read multiple files in R from the working directory and
I've read multiple similar posts on this, and my code seems to match the
How can I read multiple lines at a time from a file in Ruby?

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.