9fans archive / 1999 / 06 / 43 /    prev next

From: pip pip@cpu...
Subject: [9fans] TAS
Date: Fri, 18 Jun 1999 12:55:40 -0400 (EWT)


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 ?