interprocess synchronization primitives such as mutex, condition vars?
Chen Guojian <[email protected]> Thu, 23 Jun 2005 18:44:26 +0800
| Newsgroups | gmane.linux.redhat.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, I want to realize synchronization between mutiple threads in more than one processes, I learn that Posix semaphor is supported in Linux 2.6 and can be used in interprocess synchronization. posix semaphors have operation functions such as sem_open, sem-close, sem_unlink. =20 But I also want to use mutex and condition variables, i just know they can only be used between mutiple threads in the same process, is it right? =20 Can you tell me if they are supported for interprocess synchronization in linux 2.6 and NPTL now? and how to use them? =20 bacause pthread_mutex_t and pthread_cond_t variables are defined just in a process, how can it be seen in anothor process? I know each semaphor has a name or key to let it expose to all processes, but=20 mutex and cond vars don't have. =20 pthread_mutex_setpshared() and pthread_cond_setpshared() could be used? =20 please help me, a word will be appriciated.