From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,de5c59ca31ea055 X-Google-Attributes: gid1164f8,public From: Dave Butenhof Subject: Re: DU 4.0 threads Date: 1996/08/09 Message-ID: <320B73E5.52BF@zko.dec.com>#1/1 X-Deja-AN: 175096088 references: <4udm15$fk8@vixen.cso.uiuc.edu> content-type: text/plain; charset=us-ascii organization: Digital Equipment Corporation mime-version: 1.0 newsgroups: comp.sys.dec x-mailer: Mozilla 3.0b5aGold (X11; I; OSF1 V4.0 alpha) Steve Peltz wrote: > > Guide to DECthreads for 4.0 says, with regard to thread scheduling, that > "prior to Digital Unix Version 4.0, all threads were System Contention Scope. > In Digital UNIX Version 4.0, all threads created using DECthreads are in > Process Contention Scope. In the future, the pthread_attr_setscope function > will allow the programmer to select the desired contention scopre for each > thread created". > > Does this apply to any threaded programming running on DU4.0, or only programs > that have been compiled under 4.0, or only programs that have been compiled > under 4.0 with -pthreads instead of -threads? It applies to anything except a static binary built on earlier versions. Mixed mode scheduling gains substantial improvement in performance and in scalability (minimizing use of kernel resources for most threaded code). System contention scope isn't required by the standard, and very few programs need it, so we didn't do it. It's "in progress" now, and we'll be releasing it in a functional update... but of course I can't say when at this time. > How long do we have to wait until the pthread_attr_setscope function is > available. Is there any way now to force system contention scope? Does > this mean I should retreat back to 3.2, since I really need it to be done > the other way? You can certainly continue to use 3.2 until the appropriate 4.x update appears, if you can't live without system contention scope. I'm sorry we couldn't get everything into 4.0, but we had to make tradeoffs, and unfortunately that means that now you do, too. > Is there a list of all changes from the Draft POSIX standard that -threads > gets and the version that -pthreads gets, or is the only way to compile it > using -pthreads and start tracking down all the errors? I've already got > a small list of my own, but of course I've really only found those things > that change the syntax (such as types of variables, using NULL instead of > the various default attribute types, etc). If there are other behavioral > changes, such as the priority scheduling, or that sigaction is now global > rather than thread-specific, I'm not likely to notice it until it starts > causing problems. The Guide to DECthreads that's included with Digital UNIX 4.0 has a section describing the changes from 1003.4a/D4 (DCE threads) to POSIX threads (1003.1c-1995). It's Appendix G. It doesn't give every detail, unfortunately, because, really, every function has changed in at least one significant way. It's a port, and there's no practical way to automate it, although a few parts are as simple as a global replace. You need to look at each DCE threads call and convert it into a POSIX thread call. Appendix A gives additional information specific to Digital UNIX, including contrasts with the behavior of 3.0 and 3.2X... you've clearly seen this section, since you quoted some of it. /---[ 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 ]----------------/