Re: More benchmark bullshit, and Linux luser mating calls... (was Re: Linux betas NT in TPC testing, running Oracle8

From: Anthony Ord <nws_at_rollingthunder.demon.co.uk>
Date: Thu, 29 Apr 1999 17:22:05 GMT
Message-ID: <37347541.12022532_at_news.demon.co.uk>


On Wed, 28 Apr 1999 00:20:45 GMT, cbbrowne_at_news.hex.net (Christopher Browne) wrote:

>On 27 Apr 99 21:58:41 GMT, David Brower <dbrower_at_us.oracle.com> wrote:
>>nws_at_rollingthunder.demon.co.uk (Anthony Ord) writes:
>>>>How can pointers in structures be naughty?
>>
>>>Can someone point out how to do linked lists and binary
>>>trees without them?
>>
>>(a) Array indeces
>>(b) object references (which need not be pointers)
>>
>>Pointers as used in C are inherently "unsafe", though it is
>>silly to complain about this as a Linux problem. It's not
>>like many of the competitive OSes are written in something
>>else that is "better"

They are unsafe, but they are how a computer works.

>Handling references via arrays, and treating positions in the array as
>indices requires pointer management every bit as much as a scheme that
>has the pointers look upon "raw memory." With the upside that
>out-of-bounds conditions may possibly be caught by the language's run
>time system rather than having to rely on hardware.

Not necessarily. If you access array[714] when you "deleted" entry 714, your application will romp merrily on with the wrong data. With pointers Captain SEGV leaps up and says "You can't do that!" (Sometimes).

Upside of pointers: You don't need large areas of contiguous memory - this is less important with modern virtual memory systems - assuming you *can* use virtual memory.

Downside of pointers: Memory fragmentation if you are careless or lazy.

>Of course, if the hardware supports bounds checking nicely, it may be
>better to let the hardware manage it...
>
>And "object references" wind up as references to memory at *some*
>point.

Yes, with the added attraction of not having to use ^. Which isn't really a bind at all.

>When implementing an operating system, you have a choice:
>a) You can have pointer manipulations pervade the system, or
>
>b) You can construct some "reference management" section (aka "library"
>aka "module") that is *totally* pervaded by pointer manipulations, and
>have the rest of the system implicitly use the pointer manipulations
>from the "reference management module."

#defines?

>Note that in neither case do you get to avoid having to do grungy work
>of pointer manipulations.

It's virtually impossible to avoid when you have to implement everything from banging on the metal upwards.

Regards

Anthony

-- 
-----------------------------------------
| And when our worlds                   |
| They fall apart                       |
| When the walls come tumbling in       |
| Though we may deserve it              |
| It will be worth it  - Depeche Mode   |
-----------------------------------------
Received on Thu Apr 29 1999 - 19:22:05 CEST

Original text of this message