From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,2f95a23fb0efbf13 X-Google-Attributes: gidfa528,public X-Google-Thread: ffc1e,2f95a23fb0efbf13 X-Google-Attributes: gidffc1e,public X-Google-ArrivalTime: 2001-10-04 05:31:37 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!news.compaq.com!news.cpqcorp.net!not-for-mail From: David Butenhof Subject: Re: DCE RPC and POSIX 1003.1 Newsgroups: comp.programming.threads,comp.unix.tru64 Followup-To: comp.programming.threads References: User-Agent: KNode/0.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-ID: Date: Thu, 04 Oct 2001 08:23:11 -0400 NNTP-Posting-Host: 16.31.48.112 X-Complaints-To: abuse@Compaq.com X-Trace: news.cpqcorp.net 1002198192 16.31.48.112 (Thu, 04 Oct 2001 05:23:12 PDT) NNTP-Posting-Date: Thu, 04 Oct 2001 05:23:12 PDT Organization: Compaq Computer Corporation Xref: archiver1.google.com comp.programming.threads:6288 comp.unix.tru64:5128 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 and ... and any file compiled with -threads will cause to "chain" to .) 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 ]-----/