* pthread_mutex across process boundaries
@ 1997-06-02 4:00 Michael Rys
1997-06-04 4:00 ` Dave Butenhof
0 siblings, 1 reply; 2+ messages in thread
From: Michael Rys @ 1997-06-02 4:00 UTC (permalink / raw)
I need to port a Sun Solaris program (C/C++) to a DEC OSF1 environment.
The Sun version uses Sun's mutex_init(&sem, USYNC_PROCESS) which allows
to use the
mutex in shared memory between to processes. Newer versions of Solaris
now support
POSIX's pthread_mutex_init without losing any functionality.
Fine, I thought to myself, both OS are POSIX compliant so it should be
no problem
to port. Wrong! pthread.h on OSF1 has different calls (and even worse),
does not
seem to provide the inter-process functionality...
So I have the following questions to the experts:
1. How do I get the mutex behaviour on OSF1 for Sun's mutex_init(&sem,
USYNC_PROCESS)?
2. Is there some predefined compilation flag which tells my compiler
(g++), if I am
running OSF (similar to IBM's _AIX)? I tried __OSF__, __OSF1__ and
_OSF_SOURCE -
none worked.
Any help is greatly appreciated.
Michael
--
Michael Rys Database Group Stanford University
rys@acm.org
P: +1 415 725 0177 - F: +1 415 725 2588 -
http://www.inf.ethz.ch/personal/rys
-- Wovon man nicht sprechen kann, darueber muss man schweigen. --
Ludwig Wittgenstein, Tractatus logico-philosophicus
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: pthread_mutex across process boundaries
1997-06-02 4:00 pthread_mutex across process boundaries Michael Rys
@ 1997-06-04 4:00 ` Dave Butenhof
0 siblings, 0 replies; 2+ messages in thread
From: Dave Butenhof @ 1997-06-04 4:00 UTC (permalink / raw)
Michael Rys wrote:
>
> I need to port a Sun Solaris program (C/C++) to a DEC OSF1 environment.
> The Sun version uses Sun's mutex_init(&sem, USYNC_PROCESS) which allows
> to use the
> mutex in shared memory between to processes. Newer versions of Solaris
> now support
> POSIX's pthread_mutex_init without losing any functionality.
> Fine, I thought to myself, both OS are POSIX compliant so it should be
> no problem
> to port. Wrong! pthread.h on OSF1 has different calls (and even worse),
> does not
> seem to provide the inter-process functionality...
First off, you don't say what version of "OSF1" you're using. However,
your symptoms, and the use of "DEC OSF1" and "OSF1" rather than "Digital
UNIX" lead me to assume that you're using 3.2x or earlier. Those older
versions were released before there was any such thing as "POSIX
threads" (the standard was approved in June, 1995). They implement DCE
threads, a loose interpretation of an early draft of the standard. There
are many syntactical differences between DCE threads and POSIX threads.
Digital UNIX 4.0 supports POSIX threads, as well as the obsolete DCE
threads (for the DCE product and for binary compatibility).
However, there's another issue. "POSIX conformance" doesn't help you in
this case, because what you want is an OPTIONAL feature of the standard.
Although Digital will implement the _POSIX_THREAD_PROCESS_SHARED option
in the future, we don't yet. It hasn't been as important as a number of
other features.
> So I have the following questions to the experts:
>
> 1. How do I get the mutex behaviour on OSF1 for Sun's mutex_init(&sem,
> USYNC_PROCESS)?
You can't. Use a semaphore.
> 2. Is there some predefined compilation flag which tells my compiler
> (g++), if I am
> running OSF (similar to IBM's _AIX)? I tried __OSF__, __OSF1__ and
> _OSF_SOURCE -
> none worked.
If you want a "predefined" compilation flag, that's up to the compiler.
DEC C and DEC C++ predefine __alpha and __osf__. The g++ compiler on my
system defines the same symbols.
/---[ 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] 2+ messages in thread
end of thread, other threads:[~1997-06-04 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-06-02 4:00 pthread_mutex across process boundaries Michael Rys
1997-06-04 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