Yes, one memory segment. But imagine the following sequence of two threads:
A -> Create SHM
B -> Attempt and fail to create SHM
B -> Lookup SHM (assume mutex is initialized)
B -> Try to lock...
Type: Posts; User: CornedBee
Yes, one memory segment. But imagine the following sequence of two threads:
A -> Create SHM
B -> Attempt and fail to create SHM
B -> Lookup SHM (assume mutex is initialized)
B -> Try to lock...
How do you do it in the first place? How do you prevent one process from finding the shared memory and using it before the processes that allocated the shared memory has initialized the mutex there?...