lkml.org 
[lkml]   [2006]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch] spinlocks: remove 'volatile'


    On Thu, 6 Jul 2006, Chris Friesen wrote:
    >
    > As long as you're not talking to external devices, each cpu must be coherent
    > with respect to itself, no? It's allowed to execute out-of-order, but it
    > needs to make sure that by doing so it doesn't cause changes that are visible
    > to software.

    Right. But then "volatile" won't really matter either, unless you have
    some _ordering_ constraint, in which case "volatile" is not enough unless
    you're guaranteed to be single-threaded.

    In other words, again, "volatile" is almost always the wrong thing to
    have, and just makes you _think_ your code is correct.

    Linus
    -
    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/

    \
     
     \ /
      Last update: 2009-11-18 23:46    [W:5.241 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site