Am Mi, 13.06.2012, 00:06 schrieb Nikita Popov:

> That's how it is currently implemented. The generator backs up the
> current execution context (execute_data, CVs, Ts), pushed stack
> arguments and several executor globals. When the generator is resumed
> everything is restored and it continues to run as if nothing happened
> :)
>
> Doing context switching using setjmp family functions seems to me like
> a really scary thing to do. I don't think that one can do that in a
> sane way.

I see what you mean but would disagree :) . Working with the php context
only brings only a structural advantage. IMHO practically it's comparable
with a pure php implementation. Where it might be ok for generators as the
lexer must be touched anyway, I was talking about the base for
spl_coroutine mentioned by Laurence.

Also, some sane implementation do exist. Not only oss (see the links in my
previous mail), but even in the premium products, just to be said. Of
course it's complex, but doable, may be not right at the first step.

Anatoliy



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to