home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / arch / 8230 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  2.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!hobbes.physics.uiowa.edu!news.uiowa.edu!ns-mx!pyrite.cs.uiowa.edu
  2. From: jones@pyrite.cs.uiowa.edu (Douglas W. Jones,201H MLH,3193350740,3193382879)
  3. Newsgroups: comp.arch
  4. Subject: Re: Cache Coherence
  5. Message-ID: <13292@ns-mx.uiowa.edu>
  6. Date: 23 Jul 92 16:31:50 GMT
  7. References: <1992Jul23.140423@riese.informatik.uni-frankfurt.de>
  8. Sender: news@ns-mx.uiowa.edu
  9. Lines: 42
  10.  
  11. From article <1992Jul23.140423@riese.informatik.uni-frankfurt.de>,
  12. by feivel@riese.informatik.uni-frankfurt.de (Christine Gross):
  13. > Can anybody give me information about caches and methods to get cache
  14. > coherence ?
  15.  
  16. Plenty has been written, but here's an outline of the basic snoopy cache
  17. protocol:
  18.  
  19. Consider a memory bus with two or more processors plugged into it.  Each
  20. processor has a local write-through cache.  This leads to incoherency.
  21. To fix the problem, additional logic is added to "snoop" on the bus.  This
  22. logic listens to all write transitions from other bus clients, and if it
  23. detects a write to word X in memory, it invalidates any copy of word
  24. X in the local cache.
  25.  
  26. Now, consider what happens when the following code executes on two
  27. processors on this machine:
  28.  
  29.     Process A                Process B
  30.  
  31.      repeat                   stuff
  32.        stuff                  flag = 1
  33.      until flag = 1
  34.  
  35. If the flag is initially 0 and neither process has a cached copy of the
  36. flag, and if Process A starts polling the flag before process B finishes
  37. doing other stuff, then process A will use one bus cycle to get a copy
  38. of the flag into its local cache, and then all further polling of flag
  39. will involve no more bus cycles until some process changes the value
  40. of flag.  At that point, only one bus cycle is needed for Process A to
  41. find the new value.
  42.  
  43. Thus, with this simple snooping cache protocol, busy waiting for a
  44. variable to change its value does not create memory contention.
  45.  
  46. Commercial shared memory machines such as those made by Encore generally
  47. seem to have more interesting protocols than that described here, but
  48. they all seem to follow this spirit.
  49.                     Doug Jones
  50.                     jones@cs.uiowa.edu
  51. more int
  52.