Boost C++ Libraries: Ticket #9911: [Interprocess] get_tmp_base_dir(...) failure https://svn.boost.org/trac10/ticket/9911 <p> In Boost 1.55 get_tmp_base_dir(...) is defined as such: </p> <pre class="wiki">inline void get_tmp_base_dir(std::string &amp;tmp_name) { #if defined (BOOST_INTERPROCESS_WINDOWS) winapi::get_shared_documents_folder(tmp_name); if(tmp_name.empty() || !winapi::is_directory(tmp_name.c_str())){ tmp_name = get_temporary_path(); } #else tmp_name = get_temporary_path(); #endif if(tmp_name.empty()){ error_info err = system_error_code(); throw interprocess_exception(err); } //Remove final null. tmp_name += "/boost_interprocess"; } </pre><p> This makes an assumption in Windows that, if the "shared documents folder" is not usable, the temp folder should be used instead. I believe this is a bad assumption, and leads to silent run-time failures. </p> <p> Every user in Windows is going to have a different temp folder. Thus, processes running under different users will not agree on the same base folder for boost_interprocess. This obviously defeats the purpose of shared memory. </p> <p> I believe a failure to secure a shared location in Windows for boost_interprocess should result in an exception, not a fall back to the non-shared temp folder. </p> <p> PS - It would be beneficial if the location of the boost_interprocess folder could be specified. Instead of relying on registry entries, environment variables, or Windows API voodoo, I can tell the library exactly what folder to use, and save everyone some work. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9911 Trac 1.4.3 Ion Gaztañaga Sun, 27 Apr 2014 23:26:12 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9911#comment:1 https://svn.boost.org/trac10/ticket/9911#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Implemented the suggested workaround in commit SHA-1: fb1b0e547c8afe60cb9c1a008ce38a8606f7536d (develop branch) </p> <p> If the shared folder could not be found an exception is thrown and no temporary folder is tried. If BOOST_INTERPROCESS_SHARED_DIR_PATH is defined, that directory is used instead of the shared folder + bootstamp folder. </p> Ticket