From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sat, 19 Jun 1999 10:20:42 +0100 From: Nigel Roles ngr@symbionics.co.uk Subject: [9fans] TAS Topicbox-Message-UUID: 986cc460-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19990619092042.TlH0KZLN3Nhnwukdyi17jLnK2lFbut20l0gf_sLSJCY@z> Why implement as a call? Because inlining is not supported by the compiler, and anyway the instruction sequence has a very strong chance of being cached as it is used a lot, so performance is not really an issue. Does this make it less atomic? No. The assembler instruction is just as atomic as it was before. This is all that matters. -----Original Message----- From: pip [mailto:pip@cpu.khimaira.com] Sent: Friday, June 18, 1999 5:56 PM To: 9fans@cse.psu.edu Subject: [9fans] TAS My brief perusal of the source seems to indicate that tas(), called in sys/src/9/port/taslock.c, is implemented in the architecture specific l.s. There it seems, we splhi then issue a TAS instruction. For the SPARC architecture for example, it seems TAS maps onto a `swap' instruction, going from the plan9 asm to the underlying V8 asm, or something along those lines. Why implement tas() as a function, rather than do what it does inline. Does the additional overhead of doing a function call make this act less atomic ?