title: Shared variable in python multiprocessing
body: <p>Basically, 'refresh' is a caching function, while 'printer' is intended to serve the result to output.
  This example, obviously, fails at some point, unfortunately, python docs are no help with that.
  Besides explanations, a working code would be highly appreciated.</p>
  
  <pre><code>from multiprocessing import Manager, Process
  from random import randrange
  import time
  
  manager = Manager()
  x = manager.list()
  
  def refresh():
      global x
      while True:
          y = []
          for i in range(5):
              y.append(randrange(100))
          x = y
          time.sleep(0.2)
  
  def printer():
      while True:
          global x
          print(x)
          # Mind the different interval compared to 'refresh'
          time.sleep(0.3)
  
  if __name__=='__main__':
      p = Process(target=refresh)
      p.start()
      p1 = Process(target=printer)
      p1.start()
  </code></pre>