M
mazzawi
I know they can be shared if we use
pthread_mutexattr_setpshared with PTHREAD_PROCESS_SHARED
but does that only work if the processes are created with a fork,
after the mutex has been declared, ie
pthread_mutex_t DBMutex; /* mutex id */
fork();
so the processes know where to find the mutex.
but what if we have 2 indepednant processes. that are started
separately not forked. is there a way to use the pthread_mutex, or do
i have to use semaphores.
pthread_mutexattr_setpshared with PTHREAD_PROCESS_SHARED
but does that only work if the processes are created with a fork,
after the mutex has been declared, ie
pthread_mutex_t DBMutex; /* mutex id */
fork();
so the processes know where to find the mutex.
but what if we have 2 indepednant processes. that are started
separately not forked. is there a way to use the pthread_mutex, or do
i have to use semaphores.