<font size="2">Hello<br><br>question about copy vs deepcopy used in multithreaded context:<br><br>suppose the following program below:<br><br>the original dictionary is modified after the thread is started, the thread works on a copied and deepcopied version of the original dictionary. Is the dictionary named "originalcopy" isolated from changes in original in multithreaded context?<br><br>The program reports no errors but I want to be really sure about this<br><br>Thanks<br>Carl.<br><br><br><br><br><snip><br><br>original = {}<br>originalcopy = {}<br>originaldeepcopy = {}<br><br>class checker(threading.Thread):<br>  def __init__(self):<br>    threading.Thread.__init__(self)<br>    pass<br>  def run(self):<br>    while True:<br>      for i in originaldeepcopy:<br>        if originalcopy[i] == originaldeepcopy[i]:<br>          pass<br>        else:<br>          print "error", originalcopy[i], "Not equal to", originaldeepcopy[i]<br><br>i = 0          <br>while i<1000:<br>  original[i] = i<br>  i = i + 1<br><br>originalcopy     = copy.copy(original)<br>originaldeepcopy = copy.deepcopy(original)<br><br>test = checker()<br>test.start()<br><br>time.sleep(0.5)<br> <br>while True:  <br>  i = 0<br>  while i<1000:<br>    original[i] = i*2<br>    i = i + 1 <br></font>