I have a shared library say foo.so which contains a function called initialize(). There are multiple executables that open foo.so and each calls initialize(). I would like initialize() to check if it has already been called by another executable and if so do nothing. What’s the best way of sharing this information between these processes? Is there some special facility to share such information or do I need to use standard IPC?
I have a shared library say foo.so which contains a function called initialize() .
Share
You need to use standard IPC. Memory mapping comes to mind, but first decide whether you want initialization per user and per machine.