how to add more items to a multiprocessing queue while script in motion
问题 I am trying to learn multiprocessing with queue. What I want to do is figure out when/how to "add more items to the queue" when the script is in motion. The below script is the baseline I am working from: import multiprocessing class MyFancyClass: def __init__(self, name): self.name = name def do_something(self): proc_name = multiprocessing.current_process().name print('Doing something fancy in {} for {}!'.format( proc_name, self.name)) def worker(q): obj = q.get() obj.do_something() if _