Posts

Showing posts with the label Boost Interprocess

Boost::interprocess::named_mutex Vs CreateMutex

Answer : Caveat : I've not spent much time with boost::interprocess , so this information is just from a quick inspection of the source. That said, I've used the Windows synchronisation API's a lot, so here goes... The main difference between the two methods of interprocess synchronisation is how the object exists within the system. With boost::interprocess::named_mutex , as well as a system-specific mutex, it looks like a synchronisation object is created as a file on the system. The location of the file is based on Registry entries (see note 1) (at least in Boost 1.54.0)... it's most likely located under the Common Application Data folder (see note 2). When the aplication crashes, this file is, in your case, not removed. I'm not sure if this is by design... however in the case of an application crash, it's perhaps best not to mess with the file system, just in case . Conversely, when you use CreateMutex , an object is created at the kernel mode...