Hi all,

I am writing to get suggestion from you in our project design. Our project consists of developing a shared library in Linux to emulate the windows Registry APIs(such as RegOpenKeyEx, RegGetValue etc) exposing the same APIs as in windows. In linux we plan to save the data into an XML file format, corresponding to the windows registry. However the problem is when multiple processes use our shared library, the XML file access should be synchronized.



Can you given an idea of what could be the best synchronization mechanism for this scenario? The client suggested that we could have a daemon process that could hold the file access mechanisms synchronized through its own mutex. Can we use semaphores in this situation? We plan of using Xerces library to handle XML files. If the xerces library are thread-safe, then donít we need any special synchronization mechanisms? Is it possible to do this without daemon process? If there is a global mutex available in Linux, so that we can use only Mutex to achieve this?



Thank you very much,



Regards,

Krishna.