Compatibility of boost::interprocess::managed_shared_memory between various versions of boost

StackOverflow https://stackoverflow.com/questions/13187063

  •  29-07-2021
  •  | 
  •  

문제

Are there any explicit compatibility guarantees that boost::interprocess::managed_shared_memory would work across different boost versions? I'm planning to use it to share an integer or ten between multiple processes (which will essentially act as revision numbers for a piece of data they all read and some write). The processes are released separately and end-of-lifed once in a while.

The question is: am I locking myself down to a given version of boost for eternity because managed_shared_memory from 1.51 won't be able to talk with managed_shared_memory from 1.44 and so on?

도움이 되었습니까?

해결책

According to the Boost FAQ :

How can the Boost libraries be used successfully for important projects?

Many of the Boost libraries are actively maintained and improved, so backward compatibility with prior version isn't always possible. Deal with this by freezing the version of the Boost libraries used by your project. Only upgrade at points in your project's life cycle where a bit of change will not cause problems. Individual bug fixes can always be obtained from the boost repository.

So it seems you are locking yourself to a set of future versions of Boost Interprocess that will be compatible with the version you will use, which is an unpredictable number of versions (compatibility could be broken tomorrow as well as it could be never broken).

If you can afford to invest some time to improve your code when a new version of boost comes and breaks compatibility, you are all fine. In practice i think that is more likely to happen once every few years than once a month, libraries makers tend to take backward compatibility into consideration before publishing updates.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top