Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!decwrl!sun!gnu From: gnu@sun.uucp (John Gilmore) Newsgroups: net.arch Subject: Orthogonal addressing doesn't help multis. Message-ID: <2305@sun.uucp> Date: Sat, 15-Jun-85 04:49:36 EDT Article-I.D.: sun.2305 Posted: Sat Jun 15 04:49:36 1985 Date-Received: Mon, 17-Jun-85 03:40:17 EDT References: <419@oakhill.UUCP> <6415@boring.UUCP> <557@terak.UUCP> <6417@boring.UUCP> <572@terak.UUCP> <6431@boring.UUCP> <467@rtech.UUCP> Organization: Sun Microsystems, Inc. Lines: 26 > And furthermore, the orthogonal sequence is normally atomic... > Mark Wittenberg This is untrue on machines I know of. Typical memory-to-memory instructions do NOT lock out other memory cycles in between; this requires a specific "test-and-set" or "compare-and-swap" instruction. This is because often other cycles can be interspersed between the reads of the operands and the write of the result -- e.g. an instruction prefetch, or another data fetch. I have not checked this in National data books (I'm at home) but I'd be surprised if they lock the bus for the duration. Assuming the above is true, it means that even a single instruction e.g. add _a,_b cannot assume that 'b' will not be accessed by another processor (or dma I/O device) in mid-instruction. This is equivalent to the load, add, store case. On some machines the window where you can get hurt is smaller for the 1-instruction case, but it still exists. I once proposed adding a mode to the 68000 that would cause bus locking for memory read/write instructions (eg, add 1 to counter), but they never implemented it -- probably for good reason. The 68020 includes compare and swap, which allows arbitrary multi-instruction sequences of operations and verifies that nobody has snuck in in the middle, with very minimal penalty (an extra read) in the common case. The IBM 370 principles of operation manual used to have excellent examples of how to use it. The 68020 manual does too, I believe.