Hi folks,
got a strange one here.
I am trying to get two programs to communicate with each other on Windows 10 via shared memory. Both of them are using Boost 1.72, compiled from the same set of headers. I am only using the shared memory portion of boost.
However, one is compiled with Visual studio 2019 community, and the other one is compiled with MinGW 64, g++ version 9.2.0. I have to use MinGW, because I am writing a plugin for another program, which only takes dlls compiled with MinGW.
The program compiled with MinGW creates the shared memory and allocates several objects. Then I started the second program that was compiled with Visual Studio 2019. It was able to find and connect to the managed segment. When I am viewing the segment info from Visual Studio's debugger, everything looks ok. However, when I call get_free_memory(). It spits back 18446744073709551104, which is just bizarre.
Then, when I tried to find_or_construct on the managed segment. It just hangs, apparently stuck in winapi::sleep_tick() with the following tracedll!boost::interprocess::winapi::sleep_tick() Line 1288 C++dll!boost::interprocess::ipcdetail::thread_sleep_tick() Line 187 C++dll!boost::interprocess::spin_wait::yield() Line 128 C++dll!boost::interprocess::ipcdetail::try_based_lockboost::interprocess::ipcdetail::spin_mutex(boost::interprocess::ipcdetail::spin_mutex & m) Line 71 C++dll!boost::interprocess::ipcdetail::spin_mutex::lock() Line 81 C++dll!boost::interprocess::ipcdetail::spin_recursive_mutex::lock() Line 95 C++dll!boost::interprocess::interprocess_recursive_mutex::lock() Line 165 C++dll!boost::interprocess::scoped_lockboost::interprocess::interprocess_recursive_mutex::scoped_lockboost::interprocess::interprocess_recursive_mutex(boost::interprocess::interprocess_recursive_mutex & m) Line 81 C++dll!boost::interprocess::segment_manager