上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
摘要: Running in fooExplicit精确的 context内容 to barrunning func3 running func3 again Implicit context switch back to barExplicit context switch to foo again 阅读全文
posted @ 2018-11-19 15:32 rongye 阅读(250) 评论(0) 推荐(0)
摘要: 12563478 阅读全文
posted @ 2018-11-19 15:21 rongye 阅读(151) 评论(0) 推荐(0)
摘要: import timeimport queuedef consumer(name): print(" >starting eating baozi...") while True: new_baozi = yield print("[%s] is eating baozi %s" % (name, 阅读全文
posted @ 2018-11-19 14:58 rongye 阅读(450) 评论(0) 推荐(0)
摘要: from multiprocessing import Process, Pool,freeze_supportimport timeimport osdef Foo(i): time.sleep(2) print("in process",os.getpid()) return i + 100de 阅读全文
posted @ 2018-11-19 13:58 rongye 阅读(216) 评论(0) 推荐(0)
摘要: from multiprocessing import Process, Lockdef f(l, i): #l.acquire() print('hello world', i) #l.release()if __name__ == '__main__': lock = Lock() for nu 阅读全文
posted @ 2018-11-19 11:58 rongye 阅读(178) 评论(0) 推荐(0)
摘要: from multiprocessing import Process, Managerimport osdef f(d, l): d[os.getpid()] =os.getpid() l.append(os.getpid()) print(l)if __name__ == '__main__': 阅读全文
posted @ 2018-11-19 11:48 rongye 阅读(221) 评论(0) 推荐(0)
摘要: from multiprocessing import Process, Pipedef f(conn): conn.send([42, None, 'hello from child']) conn.send([42, None, 'hello from child3']) print("",co 阅读全文
posted @ 2018-11-19 11:42 rongye 阅读(217) 评论(0) 推荐(0)
摘要: from multiprocessing import Process, Queueimport threading#import queue# def f(q):# q.put([42, None, 'hello'])def f(qq): print("in child:",qq.qsize()) 阅读全文
posted @ 2018-11-19 11:17 rongye 阅读(139) 评论(0) 推荐(0)
摘要: main process linemodule name: __main__parent process: 2728process id: 25524 called from child process function fmodule name: __mp_main__parent process 阅读全文
posted @ 2018-11-18 21:29 rongye 阅读(241) 评论(0) 推荐(0)
摘要: from multiprocessing import Process import time def f(name): time.sleep(2) print('hello', name) if __name__ == '__main__': p = Process(target=f, args= 阅读全文
posted @ 2018-11-18 21:19 rongye 阅读(152) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页