The previous answers do not answer my question. How to share a table between 
processes? With python I can share a dictionary between processes using a 
Manager. Is there any way to do the same with Nim?
    
    
    #!/usr/bin/env python
    
    import multiprocessing
    manager = multiprocessing.Manager()
    shared_dict = manager.dict()
    
    def worker1(d):
      d["a"] = 1
    
    def worker2(d):
      d["b"] = 2
    
    process1 = multiprocessing.Process(
      target = worker1, args=[shared_dict])
    
    process2 = multiprocessing.Process(
      target=worker2, args=[shared_dict])
    
    process1.start()
    process2.start()
    
    process1.join()
    process2.join()
    
    print(shared_dict)
    
    # output {'a': 1, 'b': 2}
    
    
    Run

Reply via email to