From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc89c,da0a3bd67223917 X-Google-Attributes: gidfc89c,public X-Google-Thread: 1164f8,da0a3bd67223917 X-Google-Attributes: gid1164f8,public X-Google-Thread: f678f,da0a3bd67223917 X-Google-Attributes: gidf678f,public X-Google-Thread: 10650a,da0a3bd67223917 X-Google-Attributes: gid10650a,public From: Dave Butenhof Subject: Re: A query on DEC pthreads_mutex.. Date: 1997/04/21 Message-ID: <335B523A.4B76@zko.dec.com>#1/1 X-Deja-AN: 236337642 References: <33574AE0.36B6@wipsys.stph.net> <5jcov6$2c1@cucumber.demon.co.uk> Organization: Digital Equipment Corporation Newsgroups: comp.sys.dec,comp.unix.osf.misc,comp.unix.internals,comp.unix.programmer Andrew Gabriel wrote: > > In article <33574AE0.36B6@wipsys.stph.net>, > Kamal Kishore Mantri writes: > > > > In Digital UNIX 4.0, if I allocate the 'pthread_mutex' on > >shared memory, can I use that mutex for synchronisation among the > >threads in different processes ? > > pthread_mutexs can be either PTHREAD_PROCESS_PRIVATE (default) which > means they only work between threads in the same process, or they > can be PTHREAD_PROCESS_SHARED in which case they work between threads > in different processes also. > > I am pretty certain (but not 100%) that Digital UNIX 4.0 does support > PTHREAD_PROCESS_SHARED. Check man pages for pthread_mutexattr_init() > and pthread_mutexattr_setpshared() for how to set PTHREAD_PROCESS_SHARED. No, Digital UNIX does not (yet) support PTHREAD_PROCESS_SHARED. This is an optional POSIX feature, which for various reasons (priority, schedule, etc.) we initially chose not to implement. I can promise that we WILL support it in the future. (I'll even tell you that the new X/Open brand followon to UNIX95, called UNIX98, requires the pshared option, along with several other POSIX options.) You can always tell whether a system supports the pshared attribute by looking in for the symbol _POSIX_THREAD_PROCESS_SHARED. If defined, then the "pshared" attribute is supported -- if not defined, the attribute is not supported. /---[ Dave Butenhof ]-----------------------[ butenhof@zko.dec.com ]---\ | Digital Equipment Corporation 110 Spit Brook Rd ZKO2-3/Q18 | | 603.881.2218, FAX 603.881.0120 Nashua NH 03062-2698 | \-----------------[ Better Living Through Concurrency ]----------------/