[Interprocess] create a managed_mapped_file without allocator mutex?

I'm using managed_mapped_file to hold an index for a small property database. In various operations of boost ::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void>, 0ul> the process frequently blocks on boost::interprocess::interprocess_mutex::lock I synchronize all access to this file using interprocess mutex utilities, so write access is restricted to one single-threaded process at a time. I have looked for a deadlock between my outer mutex and the allocator's mutex, but I haven't been able to detect any process blocking on my mutex. It also might be that a process crashes while holding the allocator mutex, but in that case I don't know how to flush the allocators mutex (like I can with my own). I'm wondering if I need the allocator mutex at all, since I provide synchronization at a higher level. Is it possible to create a: typedef basic_managed_mapped_file< char,rbtree_best_fit< mutex_family
,iset_index > managed_mapped_file; That uses some kind of no-op mutex family? Can anyone give me a hint how to declare such a thing? Thanks much for any advice, Andy

El 14/03/2010 19:33, Andy Wiese escribió:
Is it possible to create a: typedef basic_managed_mapped_file< char,rbtree_best_fit< mutex_family
,iset_index > managed_mapped_file; That uses some kind of no-op mutex family? Can anyone give me a hint how to declare such a thing? Thanks much for any advice, Andy
You can customize locking in the AllocationAlgorithm because rbtree_best_fit is template<class MutexFamily, class VoidPointer, std::size_t MemAlignment> class rbtree_best_fit; use null_mutex_family declared in mutex_family.hpp typedef basic_managed_mapped_file < char,rbtree_best_fit< null_mutex_family>,iset_index > my_managed_mapped_file; Best, Ion

On Mar 18, 2010, at 10:54 AM, Ion Gaztañaga wrote:
El 14/03/2010 19:33, Andy Wiese escribió:
Is it possible to create a: typedef basic_managed_mapped_file< char,rbtree_best_fit< mutex_family
,iset_index > managed_mapped_file; That uses some kind of no-op mutex family? Can anyone give me a hint how to declare such a thing? Thanks much for any advice, Andy
You can customize locking in the AllocationAlgorithm because rbtree_best_fit is
template<class MutexFamily, class VoidPointer, std::size_t MemAlignment> class rbtree_best_fit;
use null_mutex_family declared in mutex_family.hpp
typedef basic_managed_mapped_file < char,rbtree_best_fit< null_mutex_family>,iset_index > my_managed_mapped_file;
Best,
Ion
Ion, Thanks for your excellent support of this library. I just jumped from 1.37.0 to current trunk for these experiments, and I see that the manual has also evolved nicely. Very helpful and enjoyable read. Andy
participants (2)
-
Andy Wiese
-
Ion Gaztañaga