[interprocess] maximum length for names of mutexes, memory segments etc.

A component of Boost.Flyweight called intermodule_holder internally uses some Boost.Interprocess objects with very long names intended to guarantee sistem-wide uniqueness. For instance, this is how such an internal mutex can be named (87 chars): boost_flyweight_intermodule_holder_mutex_5660_601342046_2913549788_3054690985_591945496 Alas seems like 87 chars is too much in some platforms like NetBSD: terminate called after throwing an instance of 'boost::interprocess::interprocess_exception' what(): File name too long See http://tinyurl.com/6m693p . This problem also shows in some of Boost.Inteprocess own tests for NetBSD. Is there any maximum length we can safely commit to across allplatforms? (docs are silent wrt this). Thank you, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

JOAQUIN M. LOPEZ MUÑOZ wrote:
A component of Boost.Flyweight called intermodule_holder internally uses some Boost.Interprocess objects with very long names intended to guarantee sistem-wide uniqueness. For instance, this is how such an internal mutex can be named (87 chars):
boost_flyweight_intermodule_holder_mutex_5660_601342046_2913549788_3054690985_591945496
Alas seems like 87 chars is too much in some platforms like NetBSD:
terminate called after throwing an instance of 'boost::interprocess::interprocess_exception' what(): File name too long
See http://tinyurl.com/6m693p . This problem also shows in some of Boost.Inteprocess own tests for NetBSD. Is there any maximum length we can safely commit to across allplatforms? (docs are silent wrt this).
I don't know if a portable scheme can be easily deduced. Just to be curious, does the C++ standard say anything about path or file name lengths? Maybe we should follow the same way. The path length depends on the filesystem type so finding a common scheme might be pretty difficult. Some operating system (embedded mainly) named objects require pretty short names, so I don't know what could be a portable length. Regards, Ion

Ion Gaztañaga wrote:
I don't know if a portable scheme can be easily deduced. Just to be curious, does the C++ standard say anything about path or file name lengths?
Seems like we have FILENAME_MAX. But if Interprocess emulates shared memory on users HOME or TMP folderthis this length can only be calculated on runtime, not at compile time. Any ideas? Regards, Ion
participants (2)
-
Ion Gaztañaga
-
JOAQUIN M. LOPEZ MUÑOZ