PTHREAD_PROCESS_SHARED mutex type for system-wide scope is equivalent to the USYNC_PROCESS flag to mutex_init() in the Solaris API (see below). The object initialized with this attribute must be allocated in memory shared between processes, either in System V shared memory (see shmop(2)). or in memory mapped to a file (see mmap(2)). It is illegal to initialize the object this way and to not allocate it in such shared memory.
You are indeed correct, I however, contend that if you have to write code to create shared process memory just to allocate a process wide mutex. Then a semaphor would be simpler. So in general a mutex is not process capable. Its only when its created in shared memory that its can be made process wide. Thanks for raising this point. I've learned something new. Regards, Ken James Dennett <[EMAIL PROTECTED]> wrote: > -----Original Message----- > From: Ken [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 24, 2007 1:22 PM > To: sqlite-users@sqlite.org > Subject: RE: [sqlite] Re: Some Questions Regarding Access To a SQLite > Database By More Than One Process > > If you are using seperate processes then a mutex will not help since it is > local to a process. A semaphore could be used however. Many (maybe even most) platforms support mutexes which work across multiple processes. (Mutex is, of course, short for "mutual exclusion semaphore"; there's no a priori reason to assume that mutexes are process-local while other semaphores are not.) -- James ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] ----------------------------------------------------------------------------- James Dennett <[EMAIL PROTECTED]> wrote: > -----Original Message----- > From: Ken [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 24, 2007 1:22 PM > To: sqlite-users@sqlite.org > Subject: RE: [sqlite] Re: Some Questions Regarding Access To a SQLite > Database By More Than One Process > > If you are using seperate processes then a mutex will not help since it is > local to a process. A semaphore could be used however. Many (maybe even most) platforms support mutexes which work across multiple processes. (Mutex is, of course, short for "mutual exclusion semaphore"; there's no a priori reason to assume that mutexes are process-local while other semaphores are not.) -- James ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] ----------------------------------------------------------------------------- James Dennett <[EMAIL PROTECTED]> wrote: > -----Original Message----- > From: Ken [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 24, 2007 1:22 PM > To: sqlite-users@sqlite.org > Subject: RE: [sqlite] Re: Some Questions Regarding Access To a SQLite > Database By More Than One Process > > If you are using seperate processes then a mutex will not help since it is > local to a process. A semaphore could be used however. Many (maybe even most) platforms support mutexes which work across multiple processes. (Mutex is, of course, short for "mutual exclusion semaphore"; there's no a priori reason to assume that mutexes are process-local while other semaphores are not.) -- James ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------