From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 18 Jun 1999 12:55:40 -0400 From: pip pip@cpu.khimaira.com Subject: [9fans] TAS Topicbox-Message-UUID: 98669e3c-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19990618165540.NqVGEvLJgSHndTJV2WDO6Y8U4_eEycUnnLA2PvZ6pwE@z> 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 ?