From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: 1164f8,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.226.10 with SMTP id ro10mr1516345pbc.6.1330010257266; Thu, 23 Feb 2012 07:17:37 -0800 (PST) Path: wr5ni59597pbc.0!nntp.google.com!news1.google.com!goblin3!goblin.stu.neva.ru!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.Update.UU.SE!news.Update.UU.SE!not-for-mail From: Johnny Billquist Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: PDP11 Values from MFPT Date: Thu, 23 Feb 2012 16:17:42 +0100 Organization: Update Computer Club Message-ID: References: <4f41dd56.1857737@nntp.aioe.org> <4f4434a7.18816544@nntp.aioe.org> <4f43806e.38215767@nntp.aioe.org> <4f45b539.51730368@nntp.aioe.org> <4f44f914.47689786@nntp.aioe.org> <4f45130f.54341325@nntp.aioe.org> <4f462890.125101585@nntp.aioe.org> NNTP-Posting-Host: 2620:0:105f:b:462a:60ff:fefb:aad8 Mime-Version: 1.0 X-Trace: Iltempo.Update.UU.SE 1330010256 12738 2620:0:105f:b:462a:60ff:fefb:aad8 (23 Feb 2012 15:17:36 GMT) X-Complaints-To: newsmaster@Update.UU.SE NNTP-Posting-Date: Thu, 23 Feb 2012 15:17:36 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <4f462890.125101585@nntp.aioe.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-02-23 13.42, paramucho wrote: > On Wed, 22 Feb 2012 22:17:23 +0100, Johnny Billquist > wrote: > >>>> The resource waits are something else. These are the ones where the >>>> system really do a wait for the process, while in the kernel (as opposed >>>> to the wait-for state, which essentially does not sit inside the >>>> kernel). And for the resource waits in VMS, the system totally blocks >>>> all ASTs. This is the kind of waits that I'm objecting to, and which are >>>> similar to the USR lock in RT-11. >>> >>> Yes, they block asts, and that's quite horrid. >> >> Indeed. Not fun. > > On the other hand, a user mode ast could take forever to complete. In > some cases that could paralyse a system. Uh? How do you figure? An AST is local to that process. No other process knows or cares. And neither does the OS, in any part except for doing work for that process. > The systematic solution to the issues we've been discussing would seem > to be threads. Threads provide a place to store the kernel/user > context that you have been concerned about (I still don't see a > theoretical problem). With threads you should be able to replace most > ASTs with (asynchronous) threads which wait on events. (That's how I > tend to things in Windows) Threads really don't buy you anything if you have a proper solution already. Threads are a different way of solving that processes might hang in system calls. Do it in separate threads instead. That way, it becomes "ok" for things to hang in system calls. :-) I've been thinking about writing a thread library for RSX, just for the fun of it. Because of the way RSX works, you can do a full thread implementation purely in user space. Threads are useful in that it is easier to write programs in high level languages using threads than asynchronous I/O. The problem is that they need more memory, which is a problem on a PDP-11, and the reason I have not really started writing anything. (There is also the potential problem with some HLL that they might be using a fixed event flag, making waits in several threads tricky to work in practice.) > Of course, the devil would be in the detail: which bits of behavior > would be thread-specific and which bits would be process-wide. Under > what conditions are all threads blocked (e.g. mutexes)? The answer > depends on just how independent a thread is of the parent process > context. True. > I wonder if the AST level hardware register is a process-wide or > thread-specific value... The last internals manual available is 1991 > which might be just a wee bit early for DECthreads. I would expect it to be a part of the context, and thus be thread specific. But I have not looked. >>> The REI instruction (Return from Exception or Interrupt) recognises a >>> deliverable ast state by comparing the target PSL with a >>> process-specific AST level register. It issues an ast interrupt when >>> there's a deliverable ast condition. The software then sets up the ast >>> environment according to the mode. >> >> Ah. You are talking about the AST mechanism on the VAX hardware. >> I should read up on it, since it's a long time since I studied it. >> However, I'm surprised if the whole AST handling in VMS uses that fully. > > It may have been over-engineering. For REI the hardware just compares > a bit-field in the PSL with a hardware register and triggers an > interrupt when the condition holds. You're really only saving about > three VMS instructions and you probably shouldn't have a large number > of instances of REI in a system. Whatever. I don't know whether it was > available in the other hardware implementations... The hardware AST on VAX is, I think, a required part of the architecture. I'm trying to remember how the hardware AST differs from the software controlled interrupt requests. I should probably go back and check the processor handbook. >> I wonder exactly how the code path for an AST exit works in VMS. There >> is nothing corresponding to the ASTX$ call in RSX. Instead, an AST >> routine in VMS just do a RET (not even a REI). VMS obviously sets up a >> call frame before getting to the AST routine, and gets back to some >> common piece of code to finish the AST afterwards. >> >> Need to think, look and read some more here. Could it be that AST exit >> in VMS is really handled fully in hardware without the kernel being >> involved? It might possibly be doable, but I'm not sure. > > It goes back to the kernel (to ASTDEL.MAR I guess). Thanks. Then it does work the way I thought. Johnny