Vikas89 commented on issue #10992: unlink memory shared file immediately on 
linux
URL: https://github.com/apache/incubator-mxnet/pull/10992#issuecomment-451534918
 
 
   Thanks for taking a look.
   Let me try to give exact repro steps on ec2 instance - 
   
   1. Spin up p3.2xl
   2. which python
   /home/ubuntu/anaconda3/bin//python
   3. /home/ubuntu/anaconda3/bin/pip install mxnet 
   4. copy test code  to test.py
   ```
   from multiprocessing import Queue, Event, Process
   import mxnet as mx
   import time
   
   class Producer(object):
       
       def __init__(self, input_queue):
           self.input_queue = input_queue
           
       def fill(self, length=100):
           for i in range(length):
               self.input_queue.put(mx.nd.ones((1,1)))
   
   input_queue = Queue()
   producer = Producer(input_queue)
   # producer.fill()
   preprocessor_process = Process(target=producer.fill)
   preprocessor_process.daemon = True
   preprocessor_process.start()
   # preprocessor_process2 = Process(target=producer.fill)
   # preprocessor_process2.daemon = True
   # preprocessor_process2.start()
   
   # Read without new thread
   while True:
       print(input_queue.get())
   
   class Consumer(object):
       
       def __init__(self, input_queue):
           self.input_queue = input_queue
           
       def read(self):
           while True:
               print(self.input_queue.get().shape)
   
   consumer = Consumer(input_queue)
   consumer_process = Process(target=consumer.read)
   consumer_process.daemon = True
   consumer_process.start()
   
   time.sleep(1000000)
   ```
   5. python test.py
   
   Meanwhile if I do /home/ubuntu/anaconda3/bin/pip install mxnet==1.2 
   There is no error and it works well.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to