Problem:
- Product Name: VBE for C
- Product Version: 5.2
- Product Component: C
- Full Platform Version: HP-UX 11.0
- JDK/Compiler Version: N.A.
VBE 5.2: Some FAQ about shared memory semaphores used in VB
Resolution:
Q1: When is a semaphore created/destroyed/set/reset?
- The semaphores are created when a server is started. But if the semaphores will not be created if the server is started with "vbroker.se.default.local.listener.shm=false". This will disable the use of shared memory for local IPC. - They are automatically destroyed when the server exits normally.
Q2: Does new client/server instantiate new ones or reuse existing ones?
- Each new server started will create a new set of semaphores. The client and server will use this set of semaphore to synchronize the communication.
Q3: Can a process set a semaphore and die without resetting it?
- If the server is killed with SIGKILL or exits abnormally, the semaphores and shared memory resource cannot be removed automatically by the ORB.
Q4: Would it cause other processes to hang?
- Currently there is a problem where the client has no way to find out that the server has crashed and will wait at a semaphore forever. This problem is currently being investigated.
- Also, for this version of VisiBroker, the QoS timeout policy is not effective when shared memory is used. To disable shared memory and fallback to unix domain socket for local IPC where QoS timeout policy is effective, set "vbroker.se.default.local.listener.shm=false" at the server side.
Q5: How do we identify semaphores created by VB?
- You can use the "ipcs -s -a" command to view all semaphores in the system. A sample of semaphores created by VB is below:
TID KEY MODE OWNER GROUP CREATOR CGROUP NSEMS OTIME CTIME
s248217622 0x011000ec --ra------- tgtan adc tgtan adc 4 14:58:27 14:58:06
Q6: How can we clean up semaphores no longer in use?
- The server will automatically cleanup the semaphore and shared memory resources when it exit normally. But if the server exit abnormally, then you need to remove the resources manually.
- You can use the "ipcrm -s " command to remove semaphore.
- Also need to remove temporary files inside "/tmp" directory such as orb_195_0, orb_195_0_sem & orb_195_0_shm.
#VisiBroker
#ipc
#Security



