Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: David Butenhof <David.Butenhof@compaq.com>
Subject: Re: DCE RPC and POSIX 1003.1
Date: Thu, 04 Oct 2001 08:23:11 -0400	[thread overview]
Message-ID: <QwYu7.1061$YP.25970@news.cpqcorp.net> (raw)
In-Reply-To: Pine.ULT.3.96.1011003175444.1481B-100000@STPULX.unilib.neva.ru

Rustam T. Usmanov wrote:

> Digital UNIX 4.0D, DCE 3.1.
> 
> Developing DCE RPC enabled program implies that I forced to use POSIX
> 1003.4a/d4 threads interfaces (-threads linker option).
> 
> Is there any way to use POSIX 1003.1c interfaces in such applications? In
> particular I would like to use pthread_rwlock_*.

There's no problem mixing the DCE thread and POSIX thread interfaces within 
the same program. The only restriction is that you can't use both within 
the same file. (I.e., you can't include both the real <pthread.h> and 
<dce/pthread.h>... and any file compiled with -threads will cause 
<pthread.h> to "chain" to <dce/pthread.h>.)

If there are any DCE-based interfaces you use that export or import 
"objects" from the thread API, such as pthread_t, pthread_mutex_t, or so 
forth, you also have to be careful because while the type names are the 
same the STRUCTURE of those types is very different. They're not 
interchangeable. Still, DCE thread code that happens to be running in a 
POSIX thread can synchronize using DCE thread mutexes; and your POSIX code 
could use the POSIX rwlock interfaces in a thread created using DCE 
pthread_create().

DCE thread operations can operate on POSIX threads (and vise versa) as long 
as they can get (or have been given) the proper type of pthread_t for the 
thread. A DCE library can use the DCE thread pthread_self() to get a DCE 
pthread_t for a thread created using POSIX pthread_create(), for example, 
and change its priority. But if given the POSIX pthread_t, it'll blow up 
ungracefully.

/------------------[ David.Butenhof@compaq.com ]------------------\
| Compaq Computer Corporation              POSIX Thread Architect |
|     My book: http://www.awl.com/cseng/titles/0-201-63392-2/     |
\-----[ http://home.earthlink.net/~anneart/family/dave.html ]-----/


      reply	other threads:[~2001-10-04 12:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-03 13:57 DCE RPC and POSIX 1003.1 Rustam T. Usmanov
2001-10-04 12:23 ` David Butenhof [this message]
read-only archive

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