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

From: Andrea Arcangeli (andrea@suse.de)
Date: Thu Jan 06 2000 - 12:29:24 EST


On Thu, 6 Jan 2000, Richard B. Johnson wrote:

>Well it __is__ cached into registers on this compiler (2.7.2.3)!

When I said cached into registers I meant cached this way:

        read into eax
        inc eax
        wait 1 year while doing other stuff
        write eax into memory before return

And the above would be fine as well in the do_timer case.

> movl foo,%eax ! Get it
> leal 1(%eax),%edx ! bump it by one
> movl %edx,foo ! write it back

The above is perfect for a volatile variable IMHO. Also incl (without lock
on the bus) is not atomic in SMP.

Andrea

-
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