[lkml]   [2000]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: (*(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

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.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:55    [W:0.094 / U:0.528 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site