Re: (*(unsigned long *)&jiffies)++;

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Thu Jan 06 2000 - 12:54:30 EST


On Thu, 6 Jan 2000, Davide Libenzi wrote:
>
> Why split a sigle, atomic, register clobber free and less expensive instruction
> like "incl xx" with a - load , incr , store sequence.
>
> The only reason I can see is the absence of the "incl" instruction on some
> processor.

You are correct. Many processors can not increment a memory location
directly. They have to read into a register, modify, then write it
back. At the bus level, even processors that do it all in one op-code
are really reading/modifying/writing. However, such processors are
not interrupted between these operations so they are atomic (for
that operation on that CPU only).

Cheers,
Dick Johnson

Penguin : Linux version 2.3.35 on an i686 machine (400.59 BogoMips).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jan 07 2000 - 21:00:06 EST