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

  • Home
  • SEARCH
  • 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 8261593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:27:45+00:00 2026-06-08T03:27:45+00:00

I’m a bit confused about whether to link against the libboot_*-mt variants or not

  • 0

I’m a bit confused about whether to link against the libboot_*-mt variants or not and what they’re actually used for.

I’m using a custom backport of boost 1.46.0 on Centos 6. The build produces /usr/lib64/libboost_thread-mt.so.7 as well as -mt and standard versions of the other libraries.

I’ve written a unit test program which uses a thread to store a calculation in a boost::future. To link that test I had to add -lboost_thread-mt. But I did not need to change the other boost -l args to use the -mt versions.

I’ve read the Library Naming
section on the boost site but it’s not clear to me what “indicates that the library was built with multithreading support enabled. Libraries built without multithreading support can be identified by the absence of -mt” actually means.

  1. Do i need to switch to the multithreading-aware versions of the other libraries if I link with -lboost_thread-mt? If not, when do I need to link against the -mt variants?

  2. Is there a recommendation for selectively linking against the -mt variants only if they’re needed? This project uses GNU Make for builds.

  3. Is there a performance or functional penalty for always linking against the -mt variants?

  • 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-08T03:27:47+00:00Added an answer on June 8, 2026 at 3:27 am

    The “mt” variant is built when you set threading=multi in bjam line. One of the consequences of “mt” option is that BOOST_HAS_THREADS is defined.

    Of course, all the boost libs you link shound be of the same variant, which matches the threading of your application. Otherwise you can end up with ODR violation: imagine that one compiles shared_ptr in library A without BOOST_HAS_THREADS, while library B – with BOOST_HAS_THREADS. The two shared_ptr‘s have completely different implementation of spinlock class. So, if you get shared_ptr from lib A and pass it to lib B, your program crashes. Besides, mt and non-mt variants might use different heaps.

    (That’s said, it’s worth mentioning that BOOST_HAS_THREADS depends on some other macros, and can be defined even in a non-mt variant, so mixing mt with non-mt can occasionally work — but don’t rely on this.)

    As for performance penalty – obviously, the mt variant may be a bit slower.

    UPDATE: My assumption regarding BOOST_HAS_THREADS appears to be wrong. Still, it’s a bad idea to mix mt/non-mt variants, as threading=multi affects Boost ABI.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I am using Paperclip to handle profile photo uploads in my app. They upload
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.