def __init__(self, f):
ctx = mp.get_context('spawn') # eliminate problems with fork().
pq,cq = ctx.Queue(1), ctx.Queue(1)
self.pc, self.cc = conn_master(pq, cq), conn_slave(cq,pq)
self.p = ctx.Process(target=f, args=(self.cc,), daemon=True)
self.pretty('starting process')
self.p.start()
评论列表
文章目录