Question about pthread_process_shared attribute
- From: chsalvia@xxxxxxxxx
- Date: Mon, 15 Oct 2007 12:07:54 -0000
For interprocess synchronization mutexes, it seems some
implementations of posix threads support a PTHREAD_PROCESS_SHARED
flag, which can be used so that a mutex can work between processes,
rather than only between threads.
I have two questions about this:
1: In order for inter-process synchronization to work, does the
pthread_mutex_t object need to be placed in shared memory?
2: What is the advantage/difference between using a shared mutex and
using posix semaphores. (Note, I'm not asking about System V
semaphores, which are annoying to use, but rather posix semaphores,
i.e. semaphores which use the sem_wait/sem_post system calls)
Thanks.
.
- Follow-Ups:
- Re: Question about pthread_process_shared attribute
- From: Chris Friesen
- Re: Question about pthread_process_shared attribute
- From: Eric Sosman
- Re: Question about pthread_process_shared attribute
- Prev by Date: Daemon question
- Next by Date: Re: Tying UDP socket to stdin, stdout
- Previous by thread: will system() waste memory?
- Next by thread: Re: Question about pthread_process_shared attribute
- Index(es):
Relevant Pages
|