[Stackless] About Adding Features to Stackless
tismer at stackless.com
Sun Mar 21 22:06:22 CET 2010
On 3/21/10 7:29 PM, Andrew Francis wrote:
> Hello Colleagues:
> As I have mentioned before, I have been experimenting with adding a Go select (or Limbo Alt) like features to Stackless Python. I have been using Greenlets and PyPy's Stackless.py to prototype. I am almost done and it does not resemble the way it is done in Newsqueak/Limbo/Go (for starters it is a class). I'll a modified stackless.py within the week so folks can play with it and provide suggestions.
> So far it seems that very little needs to be changed in Stackless to support this feature - merely adding a new method to channel ( I call it addOperation()) and moving the setting of _channel out of channel_action(). This all that is needed to support select like features.
> At this stage, I would like to implement this in C Stackless Python. I guess I can work on my private copy. Not that I am asking that this be necessarily included in Stackless Python. However is there a procedure for doing experimental work? This is new for me.
I think it is good to leave things as Python prototype as
is it possible. Turning things into C removes flexibility,
and ties it to Stackless' implementation, which is still
questionable for me.
If you must have it for speed, well, you can add it to
the stackless module, or better provide your own module.
Do you think it is possible to add the functionality,
or do you have to change a lot?
I am currently thinking of simplifications, this is somewhat
the opposite direction.
And now especially on the select theme:
I talked to M.v.Löwis about blocking I/O and select
in Stackless. He had quite convincing
arguments that this stuff should get a dedicated worker thread,
with blocking selects that get woken up by the system.
All poll-like approaches seem to be inferior and work only
well because we have TCP/IP.
But in UDP we would be missing packets. That rang a bell in me,
this can not be the right way.
I'd be interested to discuss this, as I am not a networking expert.
cheers - chris
Christian Tismer :^)<mailto:tismer at stackless.com>
tismerysoft GmbH : Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A : *Starship* http://starship.python.net/
14109 Berlin : PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56 mobile +49 173 24 18 776 fax +49 30 80 90 57 05
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? http://www.stackless.com/
More information about the Stackless