From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1008e3,37e683828bae12e2 X-Google-Attributes: gid1008e3,public X-Google-Thread: f8c65,37e683828bae12e2 X-Google-Attributes: gidf8c65,public X-Google-Thread: 109fba,37e683828bae12e2 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,37e683828bae12e2 X-Google-Attributes: gid1014db,public X-Google-Thread: 1164f8,b0b9a5eaad4ab6eb X-Google-Attributes: gid1164f8,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: [++] Tight coding Date: 1998/03/03 Message-ID: <1998Mar3.070659.1@eisner>#1/1 X-Deja-AN: 330380915 References: <6csl81$rb9@news-rocq.inria.fr> <34F3B7C5.5FD1@earthlink.net> <34F49435.B6307838@hda.hydro.com> <6dbgjv$lg$1@andros.cygnus.com> Reply-To: Kilgallen@eisner.decus.org.nospam X-Nntp-Posting-Host: eisner.decus.org X-Trace: news.decus.org 888926826 20874 KILGALLEN [192.67.173.2] Organization: LJK Software Newsgroups: comp.sys.dec,comp.lang.c++,comp.lang.c,comp.lang.modula2,comp.lang.modula3 In article , peter@eepjm.newcastle.edu.au (Peter Moylan) writes: > Bill Moyer wrote: >> [...] Use of memory segmentation would help pin- >>point which data structure (or catagory of data structures) >>was corrupted, and allow recovery routines to perhaps repair >>the damage and continue with application execution; this >>would be a big improvement over "Segmentation Fault; core >>dumped" or "GPF 314159". > > One of my major gripes about C is the strong influence it's > had on operating systems design. > > We have memory segmentation. We've had it for years. What > we don't have are operating systems that make proper use > of the segmentation hardware. I am not sure what further operating system support is needed. In User Mode (on VMS) as a programmer I can allocate memory sparsely in my virtual address space. I can set the protection of pages I choose to be read-only. Now I do _not_ want the operating system or compiler doing this behind my back to save me from my own programming errors in most cases, because the classes of errors that are easy to catch through _automated_ checking beyond language semantics are generally quite unlikely (so long as one avoids pointer arithmetic). One notable exception is stack guard pages (no-access pages to cause an exception if one overflows the stack), which I feel are generally useful. But I have those, thanks to collusion between the compiler and the operating system. I wouldn't mind having automatic stack expansion in each thread the way I have had it for 17 years in an unthreaded program. In a world of 64-bit addressing that is perfectly feasible for today's programs. I would classify that as an ease-of-programming issue, however, rather than a detection of defects issue. So I disagree that: "What we don't have are operating systems that make proper use of the segmentation hardware." Although of course not all operating systems are equal. I was under the impression that OS/400 had a rich selection of memory access controls, and I have always presumed the same for MVS. But I am quite willing to be proven wrong. Tell me what else the operating system could do for me, so I can put it on my wish list. Larry Kilgallen