linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How does atomic operation work on smp
@ 2012-11-08  7:01 Jimmy Pan
  2012-11-07 16:26 ` Hendrik Visage
  0 siblings, 1 reply; 4+ messages in thread
From: Jimmy Pan @ 2012-11-08  7:01 UTC (permalink / raw)
  To: linux-newbie, linux-c-programming

I understand how atomic operation work on unary core processors, I think it just disables the interrupt and dominate the cpu until it finished.
While, how do we implement this on multi processor computers?
Suppose cpu A is performing an atomic operation on variable a. At the same time, cpu B is also performing the operation on a. In such the result may be overwritten.
Of course we can use spinlocks, but on the atomic operation's behalf, how does it gurantee to prevent such case?
Can anyone explain the crux of it? Thanks.

Jimmy Pan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-08 17:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08  7:01 How does atomic operation work on smp Jimmy Pan
2012-11-07 16:26 ` Hendrik Visage
2012-11-07 16:45   ` Nicholas Mc Guire
2012-11-08 17:42     ` anish kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).