Why does he write such code?
Hello all,
I read linux-2.4 and found a line of confused code:
In kernel/sched.c:
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs