Guide Shared Memory and Semaphore Management
Shared Memory and Semaphore Issues!!!
YOU NEED TO CLEAN UP YOUR SHARED MEMORY AND SEMAPHORES
When you create shared memory or semaphores be sure to create them with a protection that makes them easy to manage, e.g.,
0644 - read/writeable by owner, read by group and by world
0666 - read/writeable by owner, by group and by world
Make sure to use:
sem_close
and
sem_unlink
to get remove semaphores.
shm_unlink
to remove shared memory.
Use
/usr/bin/ipcs
to see what is left after your programs have all terminated. Do this before leaving the lab.
Use
/usr/bin/ipcrm
to remove what is left after your programs have all terminated. Do this before leaving the lab.
A bash script to remove all your ipc remnants
ipcsscript1.txt