[d]eventlet.tpool.excute阻塞?

shiqing0477 2012-07-26 11:33:41
利用eventlet.tpool.excute(func,para1.para2)创建线程,eventlet.tpool.excute需等待func执行完了才返回?哪位大神指点一下啊?

--------------------------
Double行动:
原帖分数:40
帖子加分:40
...全文
167 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
shiqing0477 2012-07-26
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

eventlet.tpool.execute(meth, *args, **kwargs)

Execute meth in a Python thread, blocking the current coroutine/ greenthread until the method completes.

它需要等待 meth 执行完后才能继续
[/Quote]

那么eventlet库里的那些线程都是得阻塞等待的?那这样的线程的意义是?本来之所以启动新线程,就是为了在线程里执行任务,而主线程也可同时执行任务呀...

是不是应该对应pool来使用的?tpool的意义和greenpool那样,应该先开一个线程池,然后再用tpool.execute(meth, *args, **kwargs),使多个线程的meth并行执行?
bugs2k 2012-07-26
  • 打赏
  • 举报
回复
eventlet.tpool.execute(meth, *args, **kwargs)

Execute meth in a Python thread, blocking the current coroutine/ greenthread until the method completes.

它需要等待 meth 执行完后才能继续

37,720

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧