If I want to use pthread_mutex_t
and pthread_spinlock_t
in the multi-process environment, I have some questions below.
- Must I need to initialize the structure in the shared memory or use mmap()?
- If I initialize the structure in the shared-memory and set the attr PTHREAD_PROCESS_PRIVATE, what would happen?