博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python笔记04_多进程
阅读量:4294 次
发布时间:2019-05-27

本文共 451 字,大约阅读时间需要 1 分钟。

 

pid = os.fork()  if pid == 0:      print('I am child process (%s) and my parent is %s.' % (os.getpid(), os.getppid()))  else:      print('I (%s) just created a child process (%s).' % (os.getpid(), pid))  p = Process(target=run_proc, args=('test',))  print('Child process will start.')  p.start()  p.join()    p = Pool(4)  for i in range(5):  	p.apply_async(long_time_task, args=(i,))  print('Waiting for all subprocesses done...')  p.close()  p.join()

转载地址:http://hgyws.baihongyu.com/

你可能感兴趣的文章
常浏览的博客和网站
查看>>
Xcode 工程文件打开不出来, cannot be opened because the project file cannot be parsed.
查看>>
点击button实现Storyboard中TabBar Controller的tab切换
查看>>
Xcode 的正确打开方式——Debugging
查看>>
打包app出现的一个问题
查看>>
iOS在Xcode6中怎么创建OC category文件
查看>>
Expanding User-Defined Runtime Attributes in Xcode with Objective-C
查看>>
iOS7 UITabBar自定义选中图片显示为默认蓝色的Bug
查看>>
提升UITableView性能-复杂页面的优化
查看>>
25 iOS App Performance Tips & Tricks
查看>>
那些好用的iOS开发工具
查看>>
iOS最佳实践
查看>>
使用CFStringTransform将汉字转换为拼音
查看>>
更轻量的 View Controllers
查看>>
Chisel-LLDB命令插件,让调试更Easy
查看>>
时间格式化hh:mm:ss和HH:mm:ss区别
查看>>
When to use Delegation, Notification, or Observation in iOS
查看>>
Objective-C Autorelease Pool 的实现原理
查看>>
编程语言大牛王垠:编程的智慧,带你少走弯路
查看>>
ios指令集以及基于指令集的app包压缩策略
查看>>