Difference between revisions of "Talk:Swapping"
From Computer History Wiki
(→Etymology: new section) |
(→Etymology: My long-winded answer) |
||
Line 2: | Line 2: | ||
I have the impression the word "swapping" comes from drum storage, where it was possible to write a memory area to a drum sector, whilst simultaneously reading another sector into ''the same'' area. Thoughts? [[User:Larsbrinkhoff|Larsbrinkhoff]] ([[User talk:Larsbrinkhoff|talk]]) 15:24, 1 May 2025 (CEST) | I have the impression the word "swapping" comes from drum storage, where it was possible to write a memory area to a drum sector, whilst simultaneously reading another sector into ''the same'' area. Thoughts? [[User:Larsbrinkhoff|Larsbrinkhoff]] ([[User talk:Larsbrinkhoff|talk]]) 15:24, 1 May 2025 (CEST) | ||
+ | |||
+ | : After thinking about that for a while, I'm not sure that would generally have actually been possible in the hardware. Let me explain my thinking, and you can tell me if/where I have made a mistake. (Yes, yes, I know this opening part isn't an answer to the actual question you asked; I'll get to that at the bottom.) | ||
+ | : First, with most main memory technologies, it's not actually possible to read location X and write location Y ''at the same time''. E.g. with core, to read location 0200, in a 0100x0100 array, one has to 'select' location 0200 by actuating the 02 'X' line and the 0 'Y' line. One obviously can't write location 0301 at the same time. Multi-port memories, presented with two simultaneous requests, usually do first one, and then the other. (See, for example, [http://www.bitsavers.org/www.computer.museum.uq.edu.au/pdf/DEC-10-HIAA-D%20MA10%20Core%20Memory%20Maintenance%20Manual.pdf MA10 Core Memory Maintenance Manual], 3.3 Operational Description: "Priority logic contained within the MA10 is provided to establish the sequence of memory unit access when two or more ports are addressed simultaneously." Section 4.3, Request Logic, gives the operation in detail. Basically, the lower priority port is made to wait until the higher priority port is done. | ||
+ | : Of course, if the reads in your hypothetical query are higher priority (to the main memory) than the writes, that would 'sort of' work - if the sequence of read and write operations are interleaved with each other. But then we get to the second problem - contention for the storage medium. | ||
+ | : If there is only one read/write head, or one set of analog circuitry to drive the head, it can't read ''and'' write two different sectors at the same time. If there are two heads, one connected to read circuitry, and one to write, then there one can write one sector, whilst simultaneously reading another. Some machines (especially those with drum main memories, like the [[Bendix G-15]]), actually did something close to this: 'accumulator' tracks had multiple heads, spaced around the track (with the same data written in all the sections), to minimize access times. | ||
+ | : So, ''in theory'', one could have had a machine which could simultaneously write a memory block to one sector, while reading another sector into the same block - but I don't know of one that had that hardware capability. | ||
+ | : To get back to your original query, I'm pretty sure the 'swapping' referred to was just 'swapping the use of ''the'' main memory among multiple processes' (remember that CTSS used an 'onion-skin' memory allocation algorithm - i.e. only one process was ever 'swapped in' at a time). | ||
+ | : If you'd like, I can query Jerry Saltzer about the origin of the term - he lived through the start of that era, as a system programmer on CTSS. [[User:Jnc|Jnc]] ([[User talk:Jnc|talk]]) 00:05, 2 May 2025 (CEST) |
Revision as of 00:05, 2 May 2025
Etymology
I have the impression the word "swapping" comes from drum storage, where it was possible to write a memory area to a drum sector, whilst simultaneously reading another sector into the same area. Thoughts? Larsbrinkhoff (talk) 15:24, 1 May 2025 (CEST)
- After thinking about that for a while, I'm not sure that would generally have actually been possible in the hardware. Let me explain my thinking, and you can tell me if/where I have made a mistake. (Yes, yes, I know this opening part isn't an answer to the actual question you asked; I'll get to that at the bottom.)
- First, with most main memory technologies, it's not actually possible to read location X and write location Y at the same time. E.g. with core, to read location 0200, in a 0100x0100 array, one has to 'select' location 0200 by actuating the 02 'X' line and the 0 'Y' line. One obviously can't write location 0301 at the same time. Multi-port memories, presented with two simultaneous requests, usually do first one, and then the other. (See, for example, MA10 Core Memory Maintenance Manual, 3.3 Operational Description: "Priority logic contained within the MA10 is provided to establish the sequence of memory unit access when two or more ports are addressed simultaneously." Section 4.3, Request Logic, gives the operation in detail. Basically, the lower priority port is made to wait until the higher priority port is done.
- Of course, if the reads in your hypothetical query are higher priority (to the main memory) than the writes, that would 'sort of' work - if the sequence of read and write operations are interleaved with each other. But then we get to the second problem - contention for the storage medium.
- If there is only one read/write head, or one set of analog circuitry to drive the head, it can't read and write two different sectors at the same time. If there are two heads, one connected to read circuitry, and one to write, then there one can write one sector, whilst simultaneously reading another. Some machines (especially those with drum main memories, like the Bendix G-15), actually did something close to this: 'accumulator' tracks had multiple heads, spaced around the track (with the same data written in all the sections), to minimize access times.
- So, in theory, one could have had a machine which could simultaneously write a memory block to one sector, while reading another sector into the same block - but I don't know of one that had that hardware capability.
- To get back to your original query, I'm pretty sure the 'swapping' referred to was just 'swapping the use of the main memory among multiple processes' (remember that CTSS used an 'onion-skin' memory allocation algorithm - i.e. only one process was ever 'swapped in' at a time).
- If you'd like, I can query Jerry Saltzer about the origin of the term - he lived through the start of that era, as a system programmer on CTSS. Jnc (talk) 00:05, 2 May 2025 (CEST)