What's the difference between shared memory for IPCs and threads' shared memory?
问题 Let's use POSIX shared memory like shmget() - a common call to coordinate inter-process communication. How is calling shmget() and coordinating communication on the shared memory segment any different than how Linux implements shared memory and synchronization between threads in a single process. Is one of them more light-weight? 回答1: SHM is for IPC in multiple processes. In modern OS, each process cannot see each others' memory space. Using common key for shmget() to get the share memory and