我hava在我的进程中添加了一个apscheduler作业,我发现我的子进程也有这个工作, 我的主要流程和子流程同时执行这项工作......
主程序是
server = StreamServer((server_ip, server_port), serve_forever, spawn = pool, backlog=100000)
for i in range(process_count - 1):
Process(target=serve_forever, args=()).start()
我的导师是
scheduler =BackgroundScheduler()
scheduler.add_job(tick, 'interval', seconds=3)
scheduler.start()
输出
Tick! The time is: 1409042763.26 pocess is 11428
Tick! The time is: 1409042763.26 pocess is 11431
Tick! The time is: 1409042763.26 pocess is 11424
Tick! The time is: 1409042763.26 pocess is 11430
Tick! The time is: 1409042763.26 pocess is 11426
Tick! The time is: 1409042763.26 pocess is 11380
Tick! The time is: 1409042763.26 pocess is 11425
Tick! The time is: 1409042763.26 pocess is 11429
Tick! The time is: 1409042763.26 pocess is 11432
Tick! The time is: 1409042763.26 pocess is 11433
答案 0 :(得分:0)
一些想法: