lkml.org 
[lkml]   [1999]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Shared memory not SMP safe to user-mode code.
    On Tue, Nov 30, 1999 at 03:29:13PM -0500, Richard B. Johnson wrote:
    > Currently, if you were to do the trivial:
    >
    > *ptr = shared_memory;
    >
    > while (!*ptr)
    > ;
    >
    > This will loop forever, even when hardware writes non-zero to shared
    > memory. This is because the CPU "knows" that it didn't write something

    More likely the compiler knows something that is false. Have you
    used a __volatile ?

    > there since the last time it read, so the data from the last read remains
    > in its cache, never updated. Once a task-switch occurs, the loop
    > will be broken. However, this limits the maximum data-change-rate
    > to 100 Hz (the task-switch time).

    On SMP Intels the cache will be updated correctly even if a remote
    processor writes.



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

    \
     
     \ /
      Last update: 2005-03-22 13:55    [W:7.853 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site