python - Cannot get data from Queue -
i'm trying use joinable queue , didn't when join() called on queue
from multiprocessing import joinablequeue,pool q = joinablequeue() def pat(i): q.put("hello"+str(i)) q.join() print(q.get()) pool(5) p: (p.map_async(pat,range(5))).get() res = q.get() print(res+"main") q.task_done()
i data queue after process exits
can me this
.run()
directly runs process target function in main process. use .start()
fork new process.
Comments
Post a Comment