Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* A query on DEC pthreads_mutex..
@ 1997-04-18  4:00 Kamal Kishore Mantri
  1997-04-19  4:00 ` Ron Harter
  1997-04-20  4:00 ` Andrew Gabriel
  0 siblings, 2 replies; 4+ messages in thread
From: Kamal Kishore Mantri @ 1997-04-18  4:00 UTC (permalink / raw)



Hi,

	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 ?

	Thanks in advance,

Kamal
kamal@wipsys.stph.net



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A query on DEC pthreads_mutex..
  1997-04-18  4:00 A query on DEC pthreads_mutex Kamal Kishore Mantri
@ 1997-04-19  4:00 ` Ron Harter
  1997-04-20  4:00 ` Andrew Gabriel
  1 sibling, 0 replies; 4+ messages in thread
From: Ron Harter @ 1997-04-19  4:00 UTC (permalink / raw)




The mutex is for synchronization between threads of a single process, to
synchronies between process you have to use the IPC mechanism such as
semaphores or message queues.

Kamal Kishore Mantri <kamal@wipsys.stph.net> wrote in article
<33574AE0.36B6@wipsys.stph.net>...
> Hi,
> 
> 	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 ?
> 
> 	Thanks in advance,
> 
> Kamal
> kamal@wipsys.stph.net
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A query on DEC pthreads_mutex..
  1997-04-18  4:00 A query on DEC pthreads_mutex Kamal Kishore Mantri
  1997-04-19  4:00 ` Ron Harter
@ 1997-04-20  4:00 ` Andrew Gabriel
  1997-04-21  4:00   ` Dave Butenhof
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Gabriel @ 1997-04-20  4:00 UTC (permalink / raw)




In article <33574AE0.36B6@wipsys.stph.net>,
	Kamal Kishore Mantri <kamal@wipsys.stph.net> writes:
>Hi,
>
>	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.

-- 
Andrew Gabriel                        Home: Andrew@cucumber.demon.co.uk
Consultant Software Engineer          Work: Andrew.Gabriel@net-tel.co.uk




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A query on DEC pthreads_mutex..
  1997-04-20  4:00 ` Andrew Gabriel
@ 1997-04-21  4:00   ` Dave Butenhof
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Butenhof @ 1997-04-21  4:00 UTC (permalink / raw)



Andrew Gabriel wrote:
> 
> In article <33574AE0.36B6@wipsys.stph.net>,
>         Kamal Kishore Mantri <kamal@wipsys.stph.net> 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 <unistd.h> 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 ]----------------/



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-04-21  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-04-18  4:00 A query on DEC pthreads_mutex Kamal Kishore Mantri
1997-04-19  4:00 ` Ron Harter
1997-04-20  4:00 ` Andrew Gabriel
1997-04-21  4:00   ` Dave Butenhof

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox