◆ start_shm_cleaner_proc()
void gs::MemoryServices::start_shm_cleaner_proc |
( |
| ) |
|
fork a new child process to cleanup the shared memory opened in this parent process in case the parent process was killed gracefully using kill -9 (SIGKILL) or in case of uncaught run time error. For the child process to know that the parent was killed, an unmamed unix domain socket will be opened in the parent and the child processes, close one of the socket fds in the parent and close the other in the child, and poll for POLLHUB in the child to detect that the parent is hanging (may be because it is killed), in this case use the m_shmem_info_map shread with the child to clean all the opened shm instances.
these signals are already handled on the parent process block them here and wait for parent exit.
The documentation for this class was generated from the following files:
- systemc-components/common/include/memory_services.h
- systemc-components/common/src/memory_services.cc