From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fea05b9ed45ffc85 X-Google-Attributes: gid103376,public X-Google-Thread: fee84,fea05b9ed45ffc85 X-Google-Attributes: gidfee84,public From: Dave Butenhof Subject: Re: Threads under Digital OSF 4.0d Date: 1998/03/19 Message-ID: <3510FDC4.F103A8DE@zko.dec.com>#1/1 X-Deja-AN: 335839474 Content-Transfer-Encoding: 7bit References: <3507FA3C.6A92645D@zko.dec.com> <350E8A67.4EB0@gsfc.nasa.gov> <350ED209.9B44F5D2@brighttiger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Digital Equipment Corporation Newsgroups: comp.lang.ada,comp.unix.osf.osf1 Jeff Denham wrote: > Rob Kirkbride wrote (in small part: > > The problem is you don't seem to > > be able to use realtime priorities any more from Ada as it assumes > > process scope when creating the threads which is a little annoying to > > have this changed on us. I realise in C you can change this option. > > Just a reminder -- in Digital UNIX 4.0-4.0C, all pthreads are > process-scope threads. The only exception is for programs linked > statically on pre-V4.0 versions of the OS. Only in V4.0D was > system-contention scope (re)introduced. So, for a system scope (bound) > thread, the priority/policy changes will again affect the thread's > systemwide scheduling behavior. If you're not doing realtime, you should > stick with > process-scope threads (right, Dave?). The only time you need SCS (system contention scope) is when you're creating a thread that must compete, in realtime, for system-wide resources, against threads operating in another process. That includes direct access to hardware. (SCS may also benefit some "radically I/O bound" applications currently, by factoring out the cost of frequent upcalls -- but that's only because we're "not quite perfect yet"; the cost has been substantially reduced in each release since 4.0, and will continue to shrink.) It's important to have SCS capability -- but only rare applications NEED it. There are many "realtime" applications which are "soft" realtime, and whose threads need to compete only among themselves for process resources. PCS (process contention scope) is suitable for these realtime applications, and far more efficient in most cases. If you don't have critical, realtime invariants that are shared across processes, (including with the kernel "process", or hardware), then you don't need SCS. Since Ada is oriented towards realtime programming, an implementation of Ada that uses POSIX threads might consider supporting a pragma/attribute to cause specific tasks to be created using SCS threads. It might even create all threads using SCS, but that limits scaleability, and is less friendly to the system as a whole. (Unless you're writing an embedded system, that should be a concern!) /---------------------------[ Dave Butenhof ]--------------------------\ | Digital Equipment Corporation butenhof@zko.dec.com | | 110 Spit Brook Rd ZKO2-3/Q18 http://members.aol.com/drbutenhof | | Nashua NH 03062-2698 http://www.awl.com/cseng/titles/0-201-63392-2/ | \-----------------[ Better Living Through Concurrency ]----------------/