From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sat, 19 Jun 1999 12:52:43 +0100 From: forsyth@caldo.demon.co.uk forsyth@caldo.demon.co.uk Subject: [9fans] TAS Topicbox-Message-UUID: 9872cfcc-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19990619115243.56T-kLz-57R7A6yTflmAlQvNotzyZYdAjXHW4T3hjKg@z> >>architecture for example, it seems TAS maps onto a `swap' instruction, >> ... >>Why implement tas() as a function, rather than do what it does inline. it needs to use an instruction that guarantees interlock (on a multiprocessor) and i assume `swap' does that on the sparc. the instruction needed will be peculiar to an architecture, hence it's found in a platform-dependent function separate from the portable code. the linkers are in a position to inline things if need be (and do actually do some code shuffling as it is, though not perhaps in this case -- i haven't looked).