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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:01:15+00:00 2026-05-20T11:01:15+00:00

My default choice for cross-platform IPC would be boost, but I saw it criticised

  • 0

My default choice for cross-platform IPC would be boost, but I saw it criticised in two different forums when I asked about it and this concerned me. Perhaps this was simply a coincidence, so what are the thoughts on boost IPC and choosing a cross-platform C++ IPC library in general?

For Windows dev we’re using VC++ 2008 for reference.

edit: here is an example of comments I’ve seen made (can’t find them all right now):

for boost, it’s crap. At least on
windows. The Mutexes don’t use WinAPI,
instead they create it’s own
File-Based implementation (WinAPI =
Kernel-Objects). If your Program
crashes the files won’t be deleted.
Next time your Programm is launched
the mutex can’t be created, because of
the existing file.

  • 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-20T11:01:16+00:00Added an answer on May 20, 2026 at 11:01 am

    From my limited experience with Boost.Interprocess, I didn’t have any major problems but I can’t really comment on performance. While it’s true that it does use files created outside of your program’s folder to do its stuff, they should all be memory mapped which negates most of the performance problems. In any case, when you’re using IPC you should always expect some extra performance overhead.

    As for the criticism you highlighted, it is possible to remove a named mutex or any other named resources that has been left lying around by a previous process (see the static remove(const char*) function). To be fair, depending on your application, it might be tricky to use correctly which is not something you have to deal with when using the Windows API. On the other hand, the Windows API isn’t portable. My guess is that they use files (even when better alternative exists) to keep the interface and behaviour of the library consistent across different platforms.

    Anyway, named mutexes is only small part of what the library provides. One of the more useful features is that it provides its own memory managers for the shared memory region which includes STL allocators. I personally find it more pleasant to work with the high level constructs it provides then with raw memory.


    UPDATE: I did some more digging the in the Boost documentation and I came across various interesting tid bits:

    This page gives a bit more detail about the implementation and the performances of the library but doesn’t include an implementation rationale.

    This link clearly states that their Windows mutex implementation could use some work (version 1.46). If you dig a little further in the boost\interprocess\sync folder, you’ll notice two more folders named posix and emulation. Both of these contains the implementation details for the synchronisation primitive. The posix implementation for interprocess_mutex::lock is what you’d expect but the emulation implementation is pretty basic:

    // Taken from Boost 1.40.
    inline void interprocess_mutex::lock(void)
    {
       do{
          boost::uint32_t prev_s = detail::atomic_cas32(const_cast<boost::uint32_t*>(&m_s), 1, 0);
    
          if (m_s == 1 && prev_s == 0){
                break;
          }
          // relinquish current timeslice
          detail::thread_yield();
       }while (true);
    }
    

    So by the looks of it, they aimed for Posix support and blobbed everything else into an emulation layer which uses memory mapped files. If you want to know why they don’t provide a specialised Windows implementation then I suggest asking the Boost mailing list (I couldn’t find anything in the doc).

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

Sidebar

Related Questions

Some cross-platform packages like Ruby or Qt prefer %HOMEDRIVE% as the default installation path,
The default choice field display of a reference property in appengine returns the choices
By default in Date type with 'widget' => 'choice', we see that the start
By default there is a single line separator in uitableview. But I want to
Perl has long been my choice scripting language but I've run into a horrible
My program requires access to a certain UNC path, but the path is cross-domain,
In your IDE/editor of choice, do you use only the default shortcuts out of
Similar questions to this are asked periodically, but many of these answers are outdated.
Does anyone know why latin1_swedish is the default for MySQL. It would seem to
The default in Ruby on Rails is to have this set to false (in

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.