摘要: 1 register(typeid[, callable[, proxytype[, exposed[, method_to_typeid[, create_method]]]]]) 2 3 A classmethod which can be used for registering ... 阅读全文
posted @ 2015-07-01 22:55 何似王 阅读(2365) 评论(0) 推荐(0) 编辑
摘要: 1 from multiprocessing import Pool 2 import os 3 def f(x): 4 print "Os is%s"%os.getpid() 5 return x*x 6 if __name__ == '__main__': 7 pool... 阅读全文
posted @ 2015-07-01 18:03 何似王 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 官网文档的例子 1 from multiprocessing import Process, Value, Array 2 3 def f(n, a): 4 n.value = 3.1415927 5 for i in range(len(a)): 6 a[i] =... 阅读全文
posted @ 2015-07-01 10:03 何似王 阅读(2173) 评论(0) 推荐(0) 编辑
摘要: 1 #Lock.py 2 from multiprocessing import Process,Lock 3 import os 4 5 def f(l,i): 6 l.acquire() 7 print('hello world %d and Ospid is %s...' ... 阅读全文
posted @ 2015-07-01 08:55 何似王 阅读(1569) 评论(0) 推荐(0) 编辑
摘要: 1 from multiprocessing import Process,Queue,Pipe 2 import os 3 def f(q): 4 # q.send([42,None,'hello']) 5 print('This is child_conn ....' % q.r... 阅读全文
posted @ 2015-07-01 08:34 何似王 阅读(1533) 评论(0) 推荐(0) 编辑