我想使用 setproctitle 更改生成的多处理管理器 SyncManager 的进程名称,我尝试扩展 multiprocessing.managers.SyncManager:
class MySyncManager(multiprocessing.managers.SyncManager):
def __init__(self):
super(MySyncManager, self).__init__()
self.daemon=True
def run(self):
setproctitle.setproctitle('MySyncManager')
super(MySyncManager, self).run()
if __name__ == '__main__':
mySyncManager = MySyncManager()
mySyncManager.start()
但这似乎不起作用。知道怎么做吗?