Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762404AbXJZSH1 (ORCPT ); Fri, 26 Oct 2007 14:07:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752457AbXJZSHO (ORCPT ); Fri, 26 Oct 2007 14:07:14 -0400 Received: from outpipe-village-512-1.bc.nu ([81.2.110.250]:40646 "EHLO the-village.bc.nu" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754052AbXJZSHM (ORCPT ); Fri, 26 Oct 2007 14:07:12 -0400 Date: Fri, 26 Oct 2007 19:08:56 +0100 From: Alan Cox To: "Bart Van Assche" Cc: "Linus Torvalds" , "Linux Kernel Mailing List" , "Andrew Haley" Subject: Re: Is gcc thread-unsafe? Message-ID: <20071026190856.18510fc4@the-village.bc.nu> In-Reply-To: References: X-Mailer: Claws Mail 2.10.0 (GTK+ 2.10.14; i386-redhat-linux-gnu) Organization: Red Hat UK Cyf., Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, Y Deyrnas Gyfunol. Cofrestrwyd yng Nghymru a Lloegr o'r rhif cofrestru 3798903 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 758 Lines: 17 > non-volatile variables. But for asm statements this can be solved by > adding memory to the list of clobbered registers -- this will prevent > any reordering of manipulations of non-volatile variables and asm > statements. IFF the processor doesn't reorder them in hardware, which on some processors is visibly out of order when viewed from an I/O device or another CPU. You can stop the compiler but not the CPU - and some processors will certainly speculatively load across conditionals, reorder writes etc - 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/