title: Issue with trying to dynamically resize a python multiprocessing array
body: <p>Edit: Added Minimal Reproducible Problem Example</p>
  
  <p>I'm trying to create a wrapper class to emulate an ArrayList that is thread-safe. All methods seem to work fine, but the resizeBackingArray method isn't working. I've gathered that this is because I'm reassigning the value that belongs to the object, not the class, so the resized backing array won't be visible to all threads.</p>
  
  <p>What would be the best way to fix this? I know the multiprocessing.manager has functionality to use a list, but I was hoping to use the faster ctype array.</p>
  
  <p>You'll notice in the output that the array has to be resized since 15 elements are added to an array with an initial capacity of 10. However, after resizing, the copy of the list available to the main.py has a length of 10, while the size has been incremented to 15.</p>
  
  <p>Output:</p>
  
  <pre><code>Resizing
  Size of Array: 15
  Length of Array: 10
  Done!
  </code></pre>
  
  <p>From main.py</p>
  
  <pre><code>def addToList(aList):
       for x in range(0, 15):
            aList.add(x)
  
  if __name__ == "__main__": 
       import sys
       safeArray = ThreadSafeArray.SafeArrayList()
       p3 = multiprocessing.Process(target=addToList, args=(safeArray,)) 
       p3.start()
       p3.join()
       print("Size of Array: " + str(safeArray.getSize()))
       print("Length of Array: " + str(safeArray.lengthOfBackingArray()))
       print("Done!") 
  </code></pre>
  
  <p>From ThreadSafeArray.py</p>
  
  <pre><code>import multiprocessing
  import sys, traceback
  class SafeArrayList:
  
       def __init__(self, initSize = 10):
            self.arr = multiprocessing.Array('i', initSize)
            self.size = multiprocessing.Value('i', 0)
            self.lock = multiprocessing.RLock()
       #Doubles the size of the array
       def resizeBackingArray(self):
            #print("resizing")
            with self.lock:
                 newArr = multiprocessing.Array('i', self.size.value * 2)
                 for num in range(0,self.size.value):
                      newArr[num] = self.arr[num]
                 self.arr = newArr
       def add(self, num):
            with self.lock:
                 try:
                      if self.size.value == len(self.arr):
                           print("Resizing")
                           self.resizeBackingArray()
                      if self.size.value == len(self.arr):
                           print("ERROR")
                      self.arr[self.size.value] = num
                      self.size.value = self.size.value + 1
  
                 except:
                      print ('-'*60)
                      print("Error")
                      print(sys.exc_info())
                      traceback.print_exc(file=sys.stdout)
                      print ('-'*60)
                      print("Printing " + str(num))
                      print("Size = " + str(self.size.value) + "\nLength = " + str(len(self.arr)))
                      self.printArray()
  
  
       def get(self, index):
            with self.lock:
                 if index &lt; 0 or index &gt;= self.size.value:
                      return None
                 else:
                      return self.arr[index]
  
       def getSize(self):
            return self.size.value
  
       def lengthOfBackingArray(self):
            return len(self.arr)
  
       def printArray(self):
            print("Printing Array")
            for x in range(0, self.size.value):
                      print(str(self.arr[x]))
  </code></pre>