The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Re: Clever code
@ 2022-12-13  3:30 Rudi Blom
  2022-12-13  3:41 ` Warner Losh
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Rudi Blom @ 2022-12-13  3:30 UTC (permalink / raw)
  To: tuhs

[-- Attachment #1: Type: text/plain, Size: 572 bytes --]

I vaguely remember having read here about 'clever code' which took into
account the time a magnetic drum needed to rotate in order to optimise
access.

Similarly I can imagine that with resource restraints you sometimes need to
be clever in order to get your program to fit. Of course, any such
cleverness needs extra documentation.

I only ever programmed in user space but even then without lots of comment
in my code I may already start wondering what I did after only a few months
past.

Cheers,
uncle rubl
-- 
The more I learn the better I understand I know nothing.

[-- Attachment #2: Type: text/html, Size: 800 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13  3:30 [TUHS] Re: Clever code Rudi Blom
@ 2022-12-13  3:41 ` Warner Losh
  2022-12-13  3:53 ` Dave Horsfall
  2022-12-13 15:52 ` [TUHS] Re: Clever code Bakul Shah
  2 siblings, 0 replies; 24+ messages in thread
From: Warner Losh @ 2022-12-13  3:41 UTC (permalink / raw)
  To: Rudi Blom; +Cc: The Eunuchs Hysterical Society

[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]

On Mon, Dec 12, 2022, 8:32 PM Rudi Blom <rudi.j.blom@gmail.com> wrote:

>
> I vaguely remember having read here about 'clever code' which took into
> account the time a magnetic drum needed to rotate in order to optimise
> access.
>

Yes. Many ways this was done. Biggest ones were interleaving and striding.
Interleaving allowed one a little processing time for each sector while the
disk fpu. So the next logical sector isn't the next physical... and the
sectors are numbered in adjacent tracks to take into account rotation and
seek times.... there is a lot of research here...

Warner

Similarly I can imagine that with resource restraints you sometimes need to
> be clever in order to get your program to fit. Of course, any such
> cleverness needs extra documentation.
>
> I only ever programmed in user space but even then without lots of comment
> in my code I may already start wondering what I did after only a few months
> past.
>
> Cheers,
> uncle rubl
> --
> The more I learn the better I understand I know nothing.
>
>

[-- Attachment #2: Type: text/html, Size: 1780 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13  3:30 [TUHS] Re: Clever code Rudi Blom
  2022-12-13  3:41 ` Warner Losh
@ 2022-12-13  3:53 ` Dave Horsfall
  2022-12-13  4:03   ` George Michaelson
                     ` (2 more replies)
  2022-12-13 15:52 ` [TUHS] Re: Clever code Bakul Shah
  2 siblings, 3 replies; 24+ messages in thread
From: Dave Horsfall @ 2022-12-13  3:53 UTC (permalink / raw)
  To: The Eunuchs Hysterical Society

[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]

On Tue, 13 Dec 2022, Rudi Blom wrote:

> I vaguely remember having read here about 'clever code' which took into
> account the time a magnetic drum needed to rotate in order to optimise
> access.

Sounds like you're referring to SOAP (Symbolic Optimal Assembly Program) 
on the IBM 650; the programmer wrote the code "straight down" and SOAP 
reordered it for rotational latency.

> Similarly I can imagine that with resource restraints you sometimes need to
> be clever in order to get your program to fit. Of course, any such
> cleverness needs extra documentation.

Try writing a bootstrap program in 512 bytes :-)  Self-modifying code was
the order of the day...

> I only ever programmed in user space but even then without lots of comment
> in my code I may already start wondering what I did after only a few months
> past.

You could be clever in kernel space too, such as taking advantage of
the DATIP/DATO cycles on DEC's Unibus when updating a memory word i.e. 
read/modify/write.

-- Dave

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13  3:53 ` Dave Horsfall
@ 2022-12-13  4:03   ` George Michaelson
  2022-12-13  8:05     ` Ralph Corderoy
  2022-12-13  7:47   ` Ralph Corderoy
  2022-12-13 11:46   ` John P. Linderman
  2 siblings, 1 reply; 24+ messages in thread
From: George Michaelson @ 2022-12-13  4:03 UTC (permalink / raw)
  To: Dave Horsfall; +Cc: The Eunuchs Hysterical Society

The "sticky" bit was quite clever. tell the OS to keep something
memory resident, so you can binary patch the back end without
worrying.

Copy on Write was enormously clever.  Keeping FD open across fork/exec
was fantastically clever.

making a null pointer be a valid address was probably not clever
(PDP11) but I expect somebody will explain to me why it was clever.

On Tue, Dec 13, 2022 at 1:53 PM Dave Horsfall <dave@horsfall.org> wrote:
>
> On Tue, 13 Dec 2022, Rudi Blom wrote:
>
> > I vaguely remember having read here about 'clever code' which took into
> > account the time a magnetic drum needed to rotate in order to optimise
> > access.
>
> Sounds like you're referring to SOAP (Symbolic Optimal Assembly Program)
> on the IBM 650; the programmer wrote the code "straight down" and SOAP
> reordered it for rotational latency.
>
> > Similarly I can imagine that with resource restraints you sometimes need to
> > be clever in order to get your program to fit. Of course, any such
> > cleverness needs extra documentation.
>
> Try writing a bootstrap program in 512 bytes :-)  Self-modifying code was
> the order of the day...
>
> > I only ever programmed in user space but even then without lots of comment
> > in my code I may already start wondering what I did after only a few months
> > past.
>
> You could be clever in kernel space too, such as taking advantage of
> the DATIP/DATO cycles on DEC's Unibus when updating a memory word i.e.
> read/modify/write.
>
> -- Dave

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13  3:53 ` Dave Horsfall
  2022-12-13  4:03   ` George Michaelson
@ 2022-12-13  7:47   ` Ralph Corderoy
  2022-12-13 19:56     ` Dave Horsfall
  2022-12-13 11:46   ` John P. Linderman
  2 siblings, 1 reply; 24+ messages in thread
From: Ralph Corderoy @ 2022-12-13  7:47 UTC (permalink / raw)
  To: tuhs

Hi Dave,

> Rudi Blom wrote:
> > I vaguely remember having read here about 'clever code' which took
> > into account the time a magnetic drum needed to rotate in order to
> > optimise access.
>
> Sounds like you're referring to SOAP (Symbolic Optimal Assembly
> Program) 

I'd have thought the most widespread tale of drum-rotation time is the
wonderful prose version of ‘The Story of Mel’.

-- 
Cheers, Ralph.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13  4:03   ` George Michaelson
@ 2022-12-13  8:05     ` Ralph Corderoy
  2022-12-13  9:45       ` Dagobert Michelsen
  0 siblings, 1 reply; 24+ messages in thread
From: Ralph Corderoy @ 2022-12-13  8:05 UTC (permalink / raw)
  To: tuhs

Hi George,

> The "sticky" bit was quite clever. tell the OS to keep something
> memory resident

Was it ever more than a hint?  I've not heard of it locking or pinning
an executable to memory.

> so you can binary patch the back end without worrying.

I think it altered the worrying.  :-)

If not sticky, ‘chmod -x’ the file, ensure no process is running it from
before the chmod, patch, ‘chmod +x’.

If sticky then ‘chmod -tx’, ensure no process is running it from before
the chmod, ‘chmod +x’, run it and exit to remove any stuck copy,
‘chmod -x’, patch, chmod ‘+tx’.

I may have got the detail wrong but avoiding the unpatched copy
lingering in memory is the aim.

-- 
Cheers, Ralph.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13  8:05     ` Ralph Corderoy
@ 2022-12-13  9:45       ` Dagobert Michelsen
  0 siblings, 0 replies; 24+ messages in thread
From: Dagobert Michelsen @ 2022-12-13  9:45 UTC (permalink / raw)
  To: Ralph Corderoy; +Cc: segaloco via TUHS

Hi Ralph,

> Am 13.12.2022 um 09:05 schrieb Ralph Corderoy <ralph@inputplus.co.uk>:
> 
> Hi George,
> 
>> The "sticky" bit was quite clever. tell the OS to keep something
>> memory resident
> 
> Was it ever more than a hint?  I've not heard of it locking or pinning
> an executable to memory.

Funny thing is that it meant the opposite on Solaris: files with the
sticky bit set avoided the file to go through the page cache and therefore
would never be held in memory. This was e.g. set for swapfiles.
Obviously it is counterproductive to cache stuff in memory which is going
to be swapped out...


Best regards

  — Dago

-- 
"You don't become great by trying to be great, you become great by wanting to do something,
and then doing it so hard that you become great in the process." - xkcd #896


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13  3:53 ` Dave Horsfall
  2022-12-13  4:03   ` George Michaelson
  2022-12-13  7:47   ` Ralph Corderoy
@ 2022-12-13 11:46   ` John P. Linderman
  2022-12-13 14:07     ` Douglas McIlroy
  2 siblings, 1 reply; 24+ messages in thread
From: John P. Linderman @ 2022-12-13 11:46 UTC (permalink / raw)
  To: Dave Horsfall; +Cc: The Eunuchs Hysterical Society

[-- Attachment #1: Type: text/plain, Size: 1606 bytes --]

There was a story that old hands would torment newcomers to the IBM 650
by tinkering with the optimizer to make it as slow as possible (and, with
rotating drums, that could be VERY slow). Then they'd look at the
newcomer's code, make a trivial change, run it with the real optimizer,
and get dazzling improvements.

I also recall punched card bootstrap programs for the IBM 7094 that
would load column binary when run column binary, and load row binary
when run row binary. -- jpl

On Mon, Dec 12, 2022 at 10:53 PM Dave Horsfall <dave@horsfall.org> wrote:

> On Tue, 13 Dec 2022, Rudi Blom wrote:
>
> > I vaguely remember having read here about 'clever code' which took into
> > account the time a magnetic drum needed to rotate in order to optimise
> > access.
>
> Sounds like you're referring to SOAP (Symbolic Optimal Assembly Program)
> on the IBM 650; the programmer wrote the code "straight down" and SOAP
> reordered it for rotational latency.
>
> > Similarly I can imagine that with resource restraints you sometimes need
> to
> > be clever in order to get your program to fit. Of course, any such
> > cleverness needs extra documentation.
>
> Try writing a bootstrap program in 512 bytes :-)  Self-modifying code was
> the order of the day...
>
> > I only ever programmed in user space but even then without lots of
> comment
> > in my code I may already start wondering what I did after only a few
> months
> > past.
>
> You could be clever in kernel space too, such as taking advantage of
> the DATIP/DATO cycles on DEC's Unibus when updating a memory word i.e.
> read/modify/write.
>
> -- Dave

[-- Attachment #2: Type: text/html, Size: 2531 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 11:46   ` John P. Linderman
@ 2022-12-13 14:07     ` Douglas McIlroy
  2022-12-13 14:31       ` arnold
  0 siblings, 1 reply; 24+ messages in thread
From: Douglas McIlroy @ 2022-12-13 14:07 UTC (permalink / raw)
  To: John P. Linderman; +Cc: The Eunuchs Hysterical Society

Apropos of accessing rotating storage, John Kelly used to describe the
Packard-Bell 250, which had a delay-line memory, as a machine where
addresses refer to time rather than space.

The PB 250 had two instruction-sequencing modes. In one mode, each
instruction included the address of its successor. In the other mode,
whatever popped out the delay line when the current instruction
completed would be executed next.

Doug

On Tue, Dec 13, 2022 at 6:48 AM John P. Linderman <jpl.jpl@gmail.com> wrote:
>
> There was a story that old hands would torment newcomers to the IBM 650
> by tinkering with the optimizer to make it as slow as possible (and, with
> rotating drums, that could be VERY slow). Then they'd look at the
> newcomer's code, make a trivial change, run it with the real optimizer,
> and get dazzling improvements.
>
> I also recall punched card bootstrap programs for the IBM 7094 that
> would load column binary when run column binary, and load row binary
> when run row binary. -- jpl
>
> On Mon, Dec 12, 2022 at 10:53 PM Dave Horsfall <dave@horsfall.org> wrote:
>>
>> On Tue, 13 Dec 2022, Rudi Blom wrote:
>>
>> > I vaguely remember having read here about 'clever code' which took into
>> > account the time a magnetic drum needed to rotate in order to optimise
>> > access.
>>
>> Sounds like you're referring to SOAP (Symbolic Optimal Assembly Program)
>> on the IBM 650; the programmer wrote the code "straight down" and SOAP
>> reordered it for rotational latency.
>>
>> > Similarly I can imagine that with resource restraints you sometimes need to
>> > be clever in order to get your program to fit. Of course, any such
>> > cleverness needs extra documentation.
>>
>> Try writing a bootstrap program in 512 bytes :-)  Self-modifying code was
>> the order of the day...
>>
>> > I only ever programmed in user space but even then without lots of comment
>> > in my code I may already start wondering what I did after only a few months
>> > past.
>>
>> You could be clever in kernel space too, such as taking advantage of
>> the DATIP/DATO cycles on DEC's Unibus when updating a memory word i.e.
>> read/modify/write.
>>
>> -- Dave

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 14:07     ` Douglas McIlroy
@ 2022-12-13 14:31       ` arnold
  2022-12-13 14:48         ` Ralph Corderoy
                           ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: arnold @ 2022-12-13 14:31 UTC (permalink / raw)
  To: jpl.jpl, douglas.mcilroy; +Cc: tuhs

Douglas McIlroy <douglas.mcilroy@dartmouth.edu> wrote:

> Apropos of accessing rotating storage, John Kelly used to describe the
> Packard-Bell 250, which had a delay-line memory, as a machine where
> addresses refer to time rather than space.
>
> The PB 250 had two instruction-sequencing modes. In one mode, each
> instruction included the address of its successor. In the other mode,
> whatever popped out the delay line when the current instruction
> completed would be executed next.
>
> Doug

For us (relative) youngsters, can you explain some more how delay
line memory worked? The second mode you describe sounds like it
would be impossible to use if you wanted repeatable, reproducible
runs of your program.

Thanks,

Arnold

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 14:31       ` arnold
@ 2022-12-13 14:48         ` Ralph Corderoy
  2022-12-13 15:10         ` Douglas McIlroy
  2022-12-15  6:30         ` [TUHS] Delay line memory (was: Clever code) Greg 'groggy' Lehey
  2 siblings, 0 replies; 24+ messages in thread
From: Ralph Corderoy @ 2022-12-13 14:48 UTC (permalink / raw)
  To: tuhs

Hi Arnold,

> > The PB 250 had two instruction-sequencing modes.  In one mode, each
> > instruction included the address of its successor.  In the other
> > mode, whatever popped out the delay line when the current
> > instruction completed would be executed next.
...
> The second mode you describe sounds like it would be impossible to use
> if you wanted repeatable, reproducible runs of your program.

How so?  As long as the time taken by the current instruction was
constant then it would be known what's popping out of the delay line
when it's done.  And if the time varied, say because of an operand or
the need to carry, then that could be used to choose between addresses.
Either way, it's repeatable.

It is as if the PC register on today's CPU was steadily trundling
through program memory in parallel to the execution of the current
instruction and when the fetch cycle started, it got whatever PC was
pointing at.

BTW, there's https://en.wikipedia.org/wiki/Delay-line_memory if you
don't know much about them, though I don't think it covers how the
line's content was modified other than a simple block diagram showing
taps for input and output.
https://en.wikipedia.org/wiki/Delay-line_memory#/media/File:SEACComputer_010.png

-- 
Cheers, Ralph.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 14:31       ` arnold
  2022-12-13 14:48         ` Ralph Corderoy
@ 2022-12-13 15:10         ` Douglas McIlroy
  2022-12-13 15:34           ` Stuff Received
                             ` (3 more replies)
  2022-12-15  6:30         ` [TUHS] Delay line memory (was: Clever code) Greg 'groggy' Lehey
  2 siblings, 4 replies; 24+ messages in thread
From: Douglas McIlroy @ 2022-12-13 15:10 UTC (permalink / raw)
  To: arnold; +Cc: tuhs

A delay line is logically like a drum, with circulating data that is
accessible only at one point on the circle. A delay line was
effectively a linear channel along which a train of data pulses was
sent. Pulses received at the far end were reshaped electronically. and
reinjected at the sending end. One kind of delay line was a mercury
column that carried acoustic pulses.. The PB 250 delay line was
magnetostrictive (a technology I know nothing about).

If instruction timing is known, then the next instruction to appear is
predictable. The only caveat is that instruction times should not be
data-dependent. You can lay out sequential code along the circle as
long as no instruction steps on one already placed. When that happens
you must switch modes to jump to an open spot, or perhaps insert nops
to jiggle the layout.

Doug

On Tue, Dec 13, 2022 at 9:31 AM <arnold@skeeve.com> wrote:
>
> Douglas McIlroy <douglas.mcilroy@dartmouth.edu> wrote:
>
> > Apropos of accessing rotating storage, John Kelly used to describe the
> > Packard-Bell 250, which had a delay-line memory, as a machine where
> > addresses refer to time rather than space.
> >
> > The PB 250 had two instruction-sequencing modes. In one mode, each
> > instruction included the address of its successor. In the other mode,
> > whatever popped out the delay line when the current instruction
> > completed would be executed next.
> >
> > Doug
>
> For us (relative) youngsters, can you explain some more how delay
> line memory worked? The second mode you describe sounds like it
> would be impossible to use if you wanted repeatable, reproducible
> runs of your program.
>
> Thanks,
>
> Arnold

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 15:10         ` Douglas McIlroy
@ 2022-12-13 15:34           ` Stuff Received
  2022-12-13 15:56             ` Ralph Corderoy
  2022-12-13 23:02           ` Harald Arnesen
                             ` (2 subsequent siblings)
  3 siblings, 1 reply; 24+ messages in thread
From: Stuff Received @ 2022-12-13 15:34 UTC (permalink / raw)
  To: tuhs

On 2022-12-13 10:10, Douglas McIlroy wrote:
> A delay line is logically like a drum, with circulating data that is
> accessible only at one point on the circle. A delay line was
> effectively a linear channel along which a train of data pulses was
> sent. Pulses received at the far end were reshaped electronically. and
> reinjected at the sending end.

I had always thought of a delay line as a precursor to a register (or 
stack) for storing intermediate results.  Is this not an accurate way of 
thinking about it?

N.


> One kind of delay line was a mercury
> column that carried acoustic pulses.. The PB 250 delay line was
> magnetostrictive (a technology I know nothing about).
> 
> If instruction timing is known, then the next instruction to appear is
> predictable. The only caveat is that instruction times should not be
> data-dependent. You can lay out sequential code along the circle as
> long as no instruction steps on one already placed. When that happens
> you must switch modes to jump to an open spot, or perhaps insert nops
> to jiggle the layout.
> 
> Doug
> 
> On Tue, Dec 13, 2022 at 9:31 AM <arnold@skeeve.com> wrote:
>>
>> Douglas McIlroy <douglas.mcilroy@dartmouth.edu> wrote:
>>
>>> Apropos of accessing rotating storage, John Kelly used to describe the
>>> Packard-Bell 250, which had a delay-line memory, as a machine where
>>> addresses refer to time rather than space.
>>>
>>> The PB 250 had two instruction-sequencing modes. In one mode, each
>>> instruction included the address of its successor. In the other mode,
>>> whatever popped out the delay line when the current instruction
>>> completed would be executed next.
>>>
>>> Doug
>>
>> For us (relative) youngsters, can you explain some more how delay
>> line memory worked? The second mode you describe sounds like it
>> would be impossible to use if you wanted repeatable, reproducible
>> runs of your program.
>>
>> Thanks,
>>
>> Arnold


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13  3:30 [TUHS] Re: Clever code Rudi Blom
  2022-12-13  3:41 ` Warner Losh
  2022-12-13  3:53 ` Dave Horsfall
@ 2022-12-13 15:52 ` Bakul Shah
  2022-12-13 16:14   ` Ralph Corderoy
  2022-12-15  6:39   ` [TUHS] Sector interleaving (was: Clever code) Greg 'groggy' Lehey
  2 siblings, 2 replies; 24+ messages in thread
From: Bakul Shah @ 2022-12-13 15:52 UTC (permalink / raw)
  To: Rudi Blom; +Cc: tuhs

On Dec 12, 2022, at 7:30 PM, Rudi Blom <rudi.j.blom@gmail.com> wrote:
> 
> I vaguely remember having read here about 'clever code' which took into account the time a magnetic drum needed to rotate in order to optimise access.

Similar consideration applied in the early days of unix workstations.
Fortune 32:16 was a 5.6Mhz machine and couldn't process 1020KB/sec
(17 sectors/track of early ST412/ST506 disks) fast enough. As Warner
said, one dealt with it by formatting the disk so that the logical
blocks N & N+1 (from the OS PoV) were physically more than 1 sector
apart. No clever coding needed!

The "clever" coding we did was to use all 17 sectors rather than 16
+ 1 spare as was intended. Since our first disks were only 5MB in
size, we wanted to use all the space and typical error rate is much
less than 6%. This complicated handling bad blocks and slowed things
down as blocks with soft read errors were copied to blocks at the
very end of the disk. I don't recall whose idea it was but I was the
one who implemented it. I had an especially bad disk for testing on
which I used to build V7 kernels....

> Similarly I can imagine that with resource restraints you sometimes need to be clever in order to get your program to fit. Of course, any such cleverness needs extra documentation.

One has to be careful here as resource constraints change over time.
An optimization for rev N h/w can be a *pessimization* for later revs.
Even if you document code, people tend to leave "working code" alone.

> I only ever programmed in user space but even then without lots of comment in my code I may already start wondering what I did after only a few months past.

Over time comments tend to turn into fake news! Always go to the
primary sources!

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 15:34           ` Stuff Received
@ 2022-12-13 15:56             ` Ralph Corderoy
  0 siblings, 0 replies; 24+ messages in thread
From: Ralph Corderoy @ 2022-12-13 15:56 UTC (permalink / raw)
  To: tuhs

Hi N.,

> I had always thought of a delay line as a precursor to a register (or
> stack) for storing intermediate results.  Is this not an accurate way
> of thinking about it?

As an example, https://en.wikipedia.org/wiki/EDVAC#Technical_description
says

    Physically, the computer comprised the following components:

        - a magnetic tape reader-recorder (Wilkes 1956:36 describes this
          as a wire recorder.)
        ...
        - a dual memory unit consisting of two sets of 64 mercury
          acoustic delay lines of eight words capacity on each line
          [1 Ki words]
        - three temporary delay-line tanks each holding a single word

It looks like the three temporaries were more akin to a stack or
registers with the main delay lines providing working memory distinct
from tape storage.

Another analogy for a delay line might be a steadily turning Rolodex
where the card on display can be read and then written, perhaps with a
different value, before it disappears.

-- 
Cheers, Ralph.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 15:52 ` [TUHS] Re: Clever code Bakul Shah
@ 2022-12-13 16:14   ` Ralph Corderoy
  2022-12-13 16:30     ` Bakul Shah
  2022-12-15  6:39   ` [TUHS] Sector interleaving (was: Clever code) Greg 'groggy' Lehey
  1 sibling, 1 reply; 24+ messages in thread
From: Ralph Corderoy @ 2022-12-13 16:14 UTC (permalink / raw)
  To: tuhs

Hi Bakul,

> Fortune 32:16 was a 5.6Mhz machine and couldn't process 1020KB/sec
> (17 sectors/track of early ST412/ST506 disks) fast enough.  As Warner
> said, one dealt with it by formatting the disk so that the logical
> blocks N & N+1 (from the OS PoV) were physically more than 1 sector
> apart.

Sticking with ST506 hard drives, by the time the 8 MHz ARM2 from Acorn
was reading a 56 MB Rodime, it was the drive which couldn't keep up so
executables were stored compressed on disk so the CPU had something to
do, uncompressing the sector's content, while it waited for the next
sector to arrive.  :-)

-- 
Cheers, Ralph.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 16:14   ` Ralph Corderoy
@ 2022-12-13 16:30     ` Bakul Shah
  0 siblings, 0 replies; 24+ messages in thread
From: Bakul Shah @ 2022-12-13 16:30 UTC (permalink / raw)
  To: Ralph Corderoy; +Cc: tuhs

On Dec 13, 2022, at 8:14 AM, Ralph Corderoy <ralph@inputplus.co.uk> wrote:
> 
> Hi Bakul,
> 
>> Fortune 32:16 was a 5.6Mhz machine and couldn't process 1020KB/sec
>> (17 sectors/track of early ST412/ST506 disks) fast enough.  As Warner
>> said, one dealt with it by formatting the disk so that the logical
>> blocks N & N+1 (from the OS PoV) were physically more than 1 sector
>> apart.
> 
> Sticking with ST506 hard drives, by the time the 8 MHz ARM2 from Acorn
> was reading a 56 MB Rodime, it was the drive which couldn't keep up so
> executables were stored compressed on disk so the CPU had something to
> do, uncompressing the sector's content, while it waited for the next
> sector to arrive.  :-)

IIRC the slow part was due to running some common apps! Not much buffering
allowed on a 256KB machine so by the time the app asks for the next block,
on a 1:1 interleave the block would be past the read head and you had to
spend an extra revolution to grab it!

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13  7:47   ` Ralph Corderoy
@ 2022-12-13 19:56     ` Dave Horsfall
  0 siblings, 0 replies; 24+ messages in thread
From: Dave Horsfall @ 2022-12-13 19:56 UTC (permalink / raw)
  To: The Eunuchs Hysterical Society

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

On Tue, 13 Dec 2022, Ralph Corderoy wrote:

> I'd have thought the most widespread tale of drum-rotation time is the 
> wonderful prose version of ‘The Story of Mel’.

Ah yes, a classic!

-- Dave

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 15:10         ` Douglas McIlroy
  2022-12-13 15:34           ` Stuff Received
@ 2022-12-13 23:02           ` Harald Arnesen
  2022-12-14  7:31           ` arnold
  2022-12-15 18:06           ` Marc Donner
  3 siblings, 0 replies; 24+ messages in thread
From: Harald Arnesen @ 2022-12-13 23:02 UTC (permalink / raw)
  To: tuhs

Douglas McIlroy [13/12/2022 16.10]:

> A delay line is logically like a drum, with circulating data that is
> accessible only at one point on the circle. A delay line was
> effectively a linear channel along which a train of data pulses was
> sent. Pulses received at the far end were reshaped electronically. and
> reinjected at the sending end. One kind of delay line was a mercury
> column that carried acoustic pulses.

And according to Alan Turing, it might have been implemented with Gin 
and Tonic.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 15:10         ` Douglas McIlroy
  2022-12-13 15:34           ` Stuff Received
  2022-12-13 23:02           ` Harald Arnesen
@ 2022-12-14  7:31           ` arnold
  2022-12-15 18:06           ` Marc Donner
  3 siblings, 0 replies; 24+ messages in thread
From: arnold @ 2022-12-14  7:31 UTC (permalink / raw)
  To: douglas.mcilroy, arnold; +Cc: tuhs

Thank you for the explanation.  The skill of the programmers who had to
write code for such machines amazes me. I might could have held all
that kind of info in my head when I was younger, but certainly not today...

Thanks,

Arnold

Douglas McIlroy <douglas.mcilroy@dartmouth.edu> wrote:

> A delay line is logically like a drum, with circulating data that is
> accessible only at one point on the circle. A delay line was
> effectively a linear channel along which a train of data pulses was
> sent. Pulses received at the far end were reshaped electronically. and
> reinjected at the sending end. One kind of delay line was a mercury
> column that carried acoustic pulses.. The PB 250 delay line was
> magnetostrictive (a technology I know nothing about).
>
> If instruction timing is known, then the next instruction to appear is
> predictable. The only caveat is that instruction times should not be
> data-dependent. You can lay out sequential code along the circle as
> long as no instruction steps on one already placed. When that happens
> you must switch modes to jump to an open spot, or perhaps insert nops
> to jiggle the layout.
>
> Doug
>
> On Tue, Dec 13, 2022 at 9:31 AM <arnold@skeeve.com> wrote:
> >
> > Douglas McIlroy <douglas.mcilroy@dartmouth.edu> wrote:
> >
> > > Apropos of accessing rotating storage, John Kelly used to describe the
> > > Packard-Bell 250, which had a delay-line memory, as a machine where
> > > addresses refer to time rather than space.
> > >
> > > The PB 250 had two instruction-sequencing modes. In one mode, each
> > > instruction included the address of its successor. In the other mode,
> > > whatever popped out the delay line when the current instruction
> > > completed would be executed next.
> > >
> > > Doug
> >
> > For us (relative) youngsters, can you explain some more how delay
> > line memory worked? The second mode you describe sounds like it
> > would be impossible to use if you wanted repeatable, reproducible
> > runs of your program.
> >
> > Thanks,
> >
> > Arnold

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Delay line memory (was: Clever code)
  2022-12-13 14:31       ` arnold
  2022-12-13 14:48         ` Ralph Corderoy
  2022-12-13 15:10         ` Douglas McIlroy
@ 2022-12-15  6:30         ` Greg 'groggy' Lehey
  2 siblings, 0 replies; 24+ messages in thread
From: Greg 'groggy' Lehey @ 2022-12-15  6:30 UTC (permalink / raw)
  To: arnold; +Cc: douglas.mcilroy, tuhs

[-- Attachment #1: Type: text/plain, Size: 715 bytes --]

On Tuesday, 13 December 2022 at  7:31:12 -0700, arnold@skeeve.com wrote:
> For us (relative) youngsters, can you explain some more how delay
> line memory worked?

At a slight tangent, if you're ever in Melbourne (Australia, of
course), you should take a look at CSIRAC, allegedly the oldest intact
computer still in existence.  It had delay line memory.  I took some
photos of it years ago:
http://www.lemis.com/grog/photos/Photos.php?dirdate=20040904

Greg
--
Sent from my desktop computer.
Finger grog@lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Sector interleaving (was: Clever code)
  2022-12-13 15:52 ` [TUHS] Re: Clever code Bakul Shah
  2022-12-13 16:14   ` Ralph Corderoy
@ 2022-12-15  6:39   ` Greg 'groggy' Lehey
  1 sibling, 0 replies; 24+ messages in thread
From: Greg 'groggy' Lehey @ 2022-12-15  6:39 UTC (permalink / raw)
  To: Bakul Shah; +Cc: Rudi Blom, tuhs

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

On Tuesday, 13 December 2022 at  7:52:49 -0800, Bakul Shah wrote:
> On Dec 12, 2022, at 7:30 PM, Rudi Blom <rudi.j.blom@gmail.com> wrote:
>>
>> I vaguely remember having read here about 'clever code' which took
>> into account the time a magnetic drum needed to rotate in order to
>> optimise access.
>
> Similar consideration applied in the early days of unix workstations.
> Fortune 32:16 was a 5.6Mhz machine and couldn't process 1020KB/sec
> (17 sectors/track of early ST412/ST506 disks) fast enough. As Warner
> said, one dealt with it by formatting the disk so that the logical
> blocks N & N+1 (from the OS PoV) were physically more than 1 sector
> apart. No clever coding needed!

CP/M did something similar with floppy disks.  It imposed a 6 fold
software interleave between sectors (logical sectors 1, 2, 3.. were
"physical" sectors 1, 7, 13...)

On soft-sectored floppies, the "physical" sectors were really just the
numbers in the sector header.  By the time I got involved, computers
were far fast enough that they spent a lot of time just waiting for
the next sector.  I wrote a format program that positioned the
"physical" sectors so that there was only one sector between
"physical" 1, 7, 13 and so.  It made an amazing difference to the disk
speed.

Greg
--
Sent from my desktop computer.
Finger grog@lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-13 15:10         ` Douglas McIlroy
                             ` (2 preceding siblings ...)
  2022-12-14  7:31           ` arnold
@ 2022-12-15 18:06           ` Marc Donner
  2022-12-15 18:08             ` Marc Donner
  3 siblings, 1 reply; 24+ messages in thread
From: Marc Donner @ 2022-12-15 18:06 UTC (permalink / raw)
  To: Douglas McIlroy; +Cc: tuhs

[-- Attachment #1: Type: text/plain, Size: 2329 bytes --]

Further on delay line storage:

Physically one of the most common ones was a cylinder of liquid mercury.
There was a device at one end for introducing pressure waves into the
mercury (think loudspeaker) and a device at the other end for measuring the
pressure waves arriving (think microphone).  The pulses that came off the
microphone end were then fed back to the loudspeaker end, after being
cleaned up.
=====
nygeek.net
mindthegapdialogs.com/home <https://www.mindthegapdialogs.com/home>


On Tue, Dec 13, 2022 at 10:12 AM Douglas McIlroy <
douglas.mcilroy@dartmouth.edu> wrote:

> A delay line is logically like a drum, with circulating data that is
> accessible only at one point on the circle. A delay line was
> effectively a linear channel along which a train of data pulses was
> sent. Pulses received at the far end were reshaped electronically. and
> reinjected at the sending end. One kind of delay line was a mercury
> column that carried acoustic pulses.. The PB 250 delay line was
> magnetostrictive (a technology I know nothing about).
>
> If instruction timing is known, then the next instruction to appear is
> predictable. The only caveat is that instruction times should not be
> data-dependent. You can lay out sequential code along the circle as
> long as no instruction steps on one already placed. When that happens
> you must switch modes to jump to an open spot, or perhaps insert nops
> to jiggle the layout.
>
> Doug
>
> On Tue, Dec 13, 2022 at 9:31 AM <arnold@skeeve.com> wrote:
> >
> > Douglas McIlroy <douglas.mcilroy@dartmouth.edu> wrote:
> >
> > > Apropos of accessing rotating storage, John Kelly used to describe the
> > > Packard-Bell 250, which had a delay-line memory, as a machine where
> > > addresses refer to time rather than space.
> > >
> > > The PB 250 had two instruction-sequencing modes. In one mode, each
> > > instruction included the address of its successor. In the other mode,
> > > whatever popped out the delay line when the current instruction
> > > completed would be executed next.
> > >
> > > Doug
> >
> > For us (relative) youngsters, can you explain some more how delay
> > line memory worked? The second mode you describe sounds like it
> > would be impossible to use if you wanted repeatable, reproducible
> > runs of your program.
> >
> > Thanks,
> >
> > Arnold
>

[-- Attachment #2: Type: text/html, Size: 3453 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [TUHS] Re: Clever code
  2022-12-15 18:06           ` Marc Donner
@ 2022-12-15 18:08             ` Marc Donner
  0 siblings, 0 replies; 24+ messages in thread
From: Marc Donner @ 2022-12-15 18:08 UTC (permalink / raw)
  To: Douglas McIlroy; +Cc: tuhs

[-- Attachment #1: Type: text/plain, Size: 2739 bytes --]

Here is a page from the Computer History Museum on the topic:
https://www.computerhistory.org/revolution/memory-storage/8/309

about halfway down the page is a nice schematic.
=====
nygeek.net
mindthegapdialogs.com/home <https://www.mindthegapdialogs.com/home>


On Thu, Dec 15, 2022 at 1:06 PM Marc Donner <marc.donner@gmail.com> wrote:

> Further on delay line storage:
>
> Physically one of the most common ones was a cylinder of liquid mercury.
> There was a device at one end for introducing pressure waves into the
> mercury (think loudspeaker) and a device at the other end for measuring the
> pressure waves arriving (think microphone).  The pulses that came off the
> microphone end were then fed back to the loudspeaker end, after being
> cleaned up.
> =====
> nygeek.net
> mindthegapdialogs.com/home <https://www.mindthegapdialogs.com/home>
>
>
> On Tue, Dec 13, 2022 at 10:12 AM Douglas McIlroy <
> douglas.mcilroy@dartmouth.edu> wrote:
>
>> A delay line is logically like a drum, with circulating data that is
>> accessible only at one point on the circle. A delay line was
>> effectively a linear channel along which a train of data pulses was
>> sent. Pulses received at the far end were reshaped electronically. and
>> reinjected at the sending end. One kind of delay line was a mercury
>> column that carried acoustic pulses.. The PB 250 delay line was
>> magnetostrictive (a technology I know nothing about).
>>
>> If instruction timing is known, then the next instruction to appear is
>> predictable. The only caveat is that instruction times should not be
>> data-dependent. You can lay out sequential code along the circle as
>> long as no instruction steps on one already placed. When that happens
>> you must switch modes to jump to an open spot, or perhaps insert nops
>> to jiggle the layout.
>>
>> Doug
>>
>> On Tue, Dec 13, 2022 at 9:31 AM <arnold@skeeve.com> wrote:
>> >
>> > Douglas McIlroy <douglas.mcilroy@dartmouth.edu> wrote:
>> >
>> > > Apropos of accessing rotating storage, John Kelly used to describe the
>> > > Packard-Bell 250, which had a delay-line memory, as a machine where
>> > > addresses refer to time rather than space.
>> > >
>> > > The PB 250 had two instruction-sequencing modes. In one mode, each
>> > > instruction included the address of its successor. In the other mode,
>> > > whatever popped out the delay line when the current instruction
>> > > completed would be executed next.
>> > >
>> > > Doug
>> >
>> > For us (relative) youngsters, can you explain some more how delay
>> > line memory worked? The second mode you describe sounds like it
>> > would be impossible to use if you wanted repeatable, reproducible
>> > runs of your program.
>> >
>> > Thanks,
>> >
>> > Arnold
>>
>

[-- Attachment #2: Type: text/html, Size: 4593 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2022-12-15 18:09 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13  3:30 [TUHS] Re: Clever code Rudi Blom
2022-12-13  3:41 ` Warner Losh
2022-12-13  3:53 ` Dave Horsfall
2022-12-13  4:03   ` George Michaelson
2022-12-13  8:05     ` Ralph Corderoy
2022-12-13  9:45       ` Dagobert Michelsen
2022-12-13  7:47   ` Ralph Corderoy
2022-12-13 19:56     ` Dave Horsfall
2022-12-13 11:46   ` John P. Linderman
2022-12-13 14:07     ` Douglas McIlroy
2022-12-13 14:31       ` arnold
2022-12-13 14:48         ` Ralph Corderoy
2022-12-13 15:10         ` Douglas McIlroy
2022-12-13 15:34           ` Stuff Received
2022-12-13 15:56             ` Ralph Corderoy
2022-12-13 23:02           ` Harald Arnesen
2022-12-14  7:31           ` arnold
2022-12-15 18:06           ` Marc Donner
2022-12-15 18:08             ` Marc Donner
2022-12-15  6:30         ` [TUHS] Delay line memory (was: Clever code) Greg 'groggy' Lehey
2022-12-13 15:52 ` [TUHS] Re: Clever code Bakul Shah
2022-12-13 16:14   ` Ralph Corderoy
2022-12-13 16:30     ` Bakul Shah
2022-12-15  6:39   ` [TUHS] Sector interleaving (was: Clever code) Greg 'groggy' Lehey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).