BigEd wrote:
Hmm, while I do see that a small shared memory, or even a FIFO, could aid in helping efficient communication...
To be clear, it doesn't make the
communication itself, when it is occurring, any more efficient; that happens at about the same speed regardless of whether you're writing to shared memory or doing PIO.
The point is that, if reasonably well designed, most of the time it prevents either processor from having to
block when trying to communicate with the other. The blocking isn't a big deal if your purpose in having two processors is simply access to something by one processor that only the other processor has (e.g., the ability to run code in a ROM), but if your purpose is actually to increase throughput (e.g., to have one processor rendering graphics while the other does something else at the same time), having to block and do nothing while waiting for the other processor to complete an operation is obviously going to interferere with this.
Quote:
We know that Acorn's Tube protocol, or something very like it, can be sent over a parallel link (Torch's 6809) or over a serial link (JGH's serial Tube.) That's a multi-channel protocol, logically, with some chunky transfer types, but can evidently be marshalled and transferred usefully quickly.
Sure. But if I understand it right, that uses FIFOs, which are a form of shared memory. And hardware FIFOs are rather more complex to implement than basic shared memory, as far as I know. (I'd certainly be interested to see any implementations that people think are relatively simple! Or even not so simple. Acorn's is hidden in a ULA.)
Quote:
I would think the key is for the sender always to be ready with the whole block to send at the time of starting a transfer, and the receiver always being ready to read the whole block into a buffer.
This is effectly what shared memory does: since the receiver need take no action to "read" the mesage into the buffer (as opposed to processing it), the sender is never delayed (so long as there is space for another unprocessed message). Further, the receiver is free to do other useful work while messages are being sent.
As you suggest, you could probably work out something with a PIO system where one process could interrupt the other to tell it to start reading a message that the one wants to send, but you still have interrupt latency there, pauses in sending while the receiver responds to any other interrupts it receives, and significant additional handshaking complexity. (Don't take this to mean that there's no handshaking complexity at all in the shared memory system, though! You still need to ensure that partial messages aren't read and misinterpreted.)
When PIO is slow, the obvious solution is DMA. Which brings us right back to one processor being able effectively to write directly to memory that the other processor can read.
By the way, I should mention that there are probably simpler ways of doing shared memory than the way Fujitsu did it. (The FM-7 is not exactly a parsimonious, or even economical, design.) One obvious one would be Woz-style shared memory, as implemented in the Apple II, where the CPU and another system access memory on opposite phases of Φ2.