Messages in this thread |  | | | Date | Thu, 6 Jan 2000 18:37:25 +0100 (CET) | | From | Andrea Arcangeli <> | | Subject | Re: (*(unsigned long *)&jiffies)++; |
| |
On Thu, 6 Jan 2000, Tigran Aivazian wrote:
>is because I suspected that some buggy versions of gcc ignore or mishandle >it (and some people seem to confirm that, if you read this thread).
The below kind of increment is fine for a volatile variable. It's at least what I expect the compiler doing for me.
movl foo,%eax ! Get it leal 1(%eax),%edx ! bump it by one movl %edx,foo ! write it back
>atomic_t jiffies). Therefore, the more economical way of writing is >jiffies++;
Yes, more economical way for eyes.
>does not matter. Both are declared as volatile and yet jiffies were
lost_ticks_system is _not_ declared as volatile. And lost_ticks doesn't need to be declared volatile as well, but not declaring it volatile won't make any difference looking how it's used.
Only jiffies needs to be declared volatile because of free readers.
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/
|  |