Greenlets:他们现在在哪里? [英] Greenlets: where are they now???

查看:64
本文介绍了Greenlets:他们现在在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




几个星期前,我发现了Armin Rigo的小片,并认为它们很棒。我正在认真考虑使用它们,至少有人

其他是

http://www.eby-sarna.com/pipermail/p...st/001720.html


目前,我知道Greenlets或多或少地隐藏在Stackless CVS中的公众眼中,即使它们编译和工作就像一个

常规CPython的魅力。鉴于所有对完全协同程序的渴望,我听说Python-dev,greenlets将我视为真正的隐藏宝藏。这里

是我的观点:


A)为什么greenlet不被认为是协同程序的解决方案? (那么人们觉得黑客攻击C堆栈是不好的是一个令人信服的论点吗?它让我觉得CPython中的任何协程实现都必须要做到这一点
/>
这个。)


B)更高版本的CPython本身是否会支持greenlets? (在

特别是通过向PyThreadState添加适当的条目)


C)greenlets是否会被释放?是否有ToDo列表阻止他们发布




D)他是如何想出一个像Greenlet这样很酷的名字?


干杯,

David

解决方案

David Pokorny写道:
< blockquote class =post_quotes> A)为什么greenlet不被视为协程的解决方案?


也许是因为协同程序不是一个需要解决的问题。 :-)

说真的,你觉得实际问题是什么?
greenlets是一个很好的解决方案?回答可能会发现

相对较少的人实际上面临所描述的问题,

因此很少有人为其解决方案而烦恼...

D)他是怎么想出一个很酷的名字,比如Greenlet?




" Green threads"是一个相当广泛用于非本地(非操作系统)线程的术语,虽然我不知道

来源。据推测,这些是非常轻量级的非本地线程,因此是greenlet。


-Peter


< blockquote>

" Peter Hansen" < PE *** @ engcorp.com>在消息中写道

news:x6 ******************** @ powergate.ca ...

严重但是,你认为实际问题是什么?greenlets是一个很好的解决方案?




Greenlets约占解决方案的90%(我是'我认真思考了在50字节代码后中断执行的问题,同时保留了

恢复执行的能力(例如,另一个50字节)代码)。


解决方案的主要要求是:


- 它可以与普通的CPython一起使用,只需要很少的修补(一些修改) />
ceval.c是必要的。)


- 它没有做任何重新实现eval,即我不是在做生意

第二次猜测PyEval_EvalFrame。


....


换句话说,我的信息可能暗示我很关心其他人用于协同程序。我实际上对听取更多的兴趣

Armin Rigo评论Greenlets的发展状况。


BTW,最终会被中断的代码50字节代码是

不是我自己的---它将是Python机器人,由用户编写......友好

用户......(< suspicious浏览弃用的rexec>)


David


David Pokorny写道:

彼得汉森 < PE *** @ engcorp.com>在消息中写道
新闻:x6 ******************** @ powergate.ca ...

严重但是,你感觉到的实际问题是什么?greenlets是一个很好的解决方案?



Greenlets约占解决方案的90%(我认为很难)在50字节代码后中断执行的问题,同时保留恢复执行的能力(例如,另一个50字节代码)。




Python的常规线程已经允许这样做了,所以必须要有更多的东西。


-Peter


Hi,

A few weeks ago, I discovered Armin Rigo''s greenlets and thought they were
brilliant. I''m seriously thinking about using them, and at least someone
else is

http://www.eby-sarna.com/pipermail/p...st/001720.html

Currently, I understand that Greenlets are more-or-less hidden from the
public eye in the Stackless CVS, even though they compile and work like a
charm with regular CPython. Given all the desire for full coroutines that I
hear on Python-dev, greenlets strike me as genuine "hidden treasure." Here
is my point:

A) Why aren''t greenlets being considered as a solution to coroutines? (Do
people feel that "hacking the C stack is bad" is a compelling argument? It
strikes me that any coroutine implementation in CPython will have to do
this.)

B) Will a later version of CPython support greenlets natively? (in
particular by adding the appropriate entries to PyThreadState)

C) Will greenlets ever be released? Is there a ToDo list that prevents their
release?

D) How did he come up with a cool name like "Greenlet"?

Cheers,
David

解决方案

David Pokorny wrote:

A) Why aren''t greenlets being considered as a solution to coroutines?
Maybe because coroutines aren''t a problem that needs to be solved. :-)
Seriously though, what is the actual problem to which you feel
greenlets are a good solution? Answering that might reveal that
relatively few people actually face the problem described,
thus few people bother with its solution...
D) How did he come up with a cool name like "Greenlet"?



"Green threads" is a term that is fairly widely used for
non-native (non-OS) threads, though I have no idea of the
origin. Presumably these are a lightweight type of non-
native thread, thus greenlet.

-Peter



"Peter Hansen" <pe***@engcorp.com> wrote in message
news:x6********************@powergate.ca...

Seriously though, what is the actual problem to which you feel
greenlets are a good solution?



Greenlets are about 90% of a solution (which I''ve thought hard about) to the
problem of interrupting an execution after 50 byte-code, while retaining the
ability to resume the execution (for, say, another 50 byte codes).

The main requirements of the solution are:

- it work with regular CPython with minimal tinkering (some tinkering of
ceval.c is necessary).

- it not do any "reimplementing eval," i.e. I''m not in the business of
second-guessing PyEval_EvalFrame.

....

In other words, my message may have implied that I''m concerned with other
people''s uses for coroutines. I''m actually much more interested in hearing
Armin Rigo comment on the development status of Greenlets.

BTW, the code that ultimately will get interrupted every 50 byte codes is
not my own---it will be Python bots, written by users... ...friendly
users... (<suspicious glance at deprecated rexec>)

David


David Pokorny wrote:

"Peter Hansen" <pe***@engcorp.com> wrote in message
news:x6********************@powergate.ca...

Seriously though, what is the actual problem to which you feel
greenlets are a good solution?



Greenlets are about 90% of a solution (which I''ve thought hard about) to the
problem of interrupting an execution after 50 byte-code, while retaining the
ability to resume the execution (for, say, another 50 byte codes).



Python''s regular threads already allow this, so there must be
something more to it.

-Peter


这篇关于Greenlets:他们现在在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆