Why does he write such code?
am 19.01.2009 05:58:49 von zhangsongHello all,=20
I read linux-2.4 and found a line of confused code:
In kernel/sched.c:
=20
void do_timer(struct pt_regs * regs)
{
¡¡¡¡ (*(unsigned long *)&jiffies)++; /* confused code */
¡¡¡¡¡¡¡¡¡
}
1. Why not to use something link atomic_inc insead of the above code?
2. Can the GCC optimize the above code to jiffies++ ?
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie"=
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs