On Tue, Jul 12, 2011 at 3:30 PM, Anselm Kruis
<[email protected]> wrote:
> I'm far from understanding the code completely.

If you have any questions, feel free to ask on the list.

> I looked at the switching code of the greenlet project
> (http://codespeak.net/py/0.9.2/apigen/source/c-extension/greenlet/switch_amd64_unix.h.html)
> Pretty much the same as our old version of the code.

The original stack switching code for greenlet was taken from
Stackless.  However, be aware that greenlet is no longer hosted on
codespeak, and that the place to go for it is here:

  https://bitbucket.org/ambroff/greenlet/

> Here is some discussion about the context switch for amd64:
> http://code.google.com/p/coev/wiki/GreenletProblems The page contains a link

That's an interesting page.  I had no idea that greenlet was so
problematic (in theory).  In practice, I imagine that the selective
range of switched registers are reasonable and sufficient for normal
usage.  Of course, that doesn't make it right, but I will touch on
that further below.  Regarding more architecture neutral problems like
the threadstate and exception aspect, I expect that is abstracted away
in any decent framework.  Otherwise I wouldn't expect people to have
confidence in gevent based solutions, as evidenced in the following:

  http://tarekziade.wordpress.com/2011/07/12/firefox-sync-python/

> to the amd64 ABI specification http://www.x86-64.org/documentation.html.
> I'll try to read it later.

Note that (speaking at least on behalf of myself) the switching code
was generally written based using research on which registers were
supposed to be solved.  Often it is difficult to locate any resource
that clearly states what registers have to be saved for a platform.
So do not take the existing sets as being gospel.  In some cases
platforms have changed and required changes to the switching logic.

Cheers,
Richard.

_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless

Reply via email to