Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753949AbZJZRT1 (ORCPT ); Mon, 26 Oct 2009 13:19:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752011AbZJZRT0 (ORCPT ); Mon, 26 Oct 2009 13:19:26 -0400 Received: from mail-pz0-f188.google.com ([209.85.222.188]:60463 "EHLO mail-pz0-f188.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751876AbZJZRTZ (ORCPT ); Mon, 26 Oct 2009 13:19:25 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=KUjFUddyHPdww8IPA530th3sLsUBPxOSC03FTCtOJkXohxTl7G6/qbG0fygqEBFmK9 i+ObwJXsHKGtxu7vetDSuKnpSxAOrE2j5aWiDjSb+zkC+2W0lpXGZKE6E087PvmZlBQa eLPl0JBS8yXfDPJcKNC/miqrf8aQUDRMXOdxc= MIME-Version: 1.0 Date: Mon, 26 Oct 2009 22:49:30 +0530 Message-ID: Subject: Difference between atomic operations and memory barriers From: "Leonidas ." To: linux-kernel Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 775 Lines: 23 Trying to understand difference between atomic ops and memory barriers. I was thinking all atomic operations must be using barrier internally, but I read somewhere that only some of them use barriers. Sorry for being vague here. Operations before call to smp_mb() will not be re-ordered and all cpus will see consistent value after the variable is updated. E.g. void * ptr = (void *) str; smb_mb(); Will this not atomically update ptr? Ptr will be seen by all cpu's in same state after it has been assigned str, right? -Leo. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" 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.tux.org/lkml/