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

From: Petko Manolov (petkan@spct.net)
Date: Fri Jan 07 2000 - 06:19:58 EST


Andrea Arcangeli wrote:
>
> On Fri, 7 Jan 2000, Petko Manolov wrote:
> >AFAIK incl _lock_ the bus even without "lock" in fornt of the
> >instruction
>
> The lock on the bus is _necessary_ in SMP. It would be very bad if each
> incl would implicitly do a lock on the bus. It would forbid you to use
> incl in SMP for single threaded code (for example inside critical
> sections).

Lock don't hurt anyway.
May be i am not right, but i think there was some simple instructions
(not only incl) that force lock before them in both cases.
 
> Even if it would lock on the bus it wouldn't matter. C only knows about
> signle threading. So as far as C is concerned it's fine if it doesn't use
> incl for incrementing volatile variables IMHO.

I think so. The RISC-ifing make gcc optimize it as read, inc, write...
But this tread become pointless ;-))

regards,
Petkan

-
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:08 EST