[Stackless] Pickling Tasklets waiting on Channels RE: Giving names for tasklets
Andrew Francis
andrewfr_ice at yahoo.com
Fri Jun 30 20:20:15 CEST 2006
Hello Richard, Juho, et al... :
Wow, I almost missed this thread...
> Something I was going to mention about naming
>tasklets, is how we do it a little bit differently at
>CCP. Maybe it is in the slides
>from the presentation Kristj?n made at PyCon. We
name >our tasklets something like "Vague
Category/Specific >Label" and then profile time in the
>tasklet to this hierarchical name.
>Nice icea. I was thinking of some type task grouping
>and that's a nice, easy and simple way to do it.
This sounds interesting. I would like to give names to
tasklets and groups of tasklets.
>Anyway, I ran into more problems, this time with
>pickling.Our game (projectxenocide) will use tasklets
>to script AI (for example). Another thing is how I
>should pickle and unpickle a group of tasklets
>which communicate together with channels?
RT>When I was debugging a pickling problem Andrew
RT>Francis had, this is how I believe it worked:
RT>Pickling a tasklet blocked on a channel, where
there RT>is no reference held to the channel, will
result in RT>that tasklet being pickled, blocked, but
not on the RT>channel. I do not believe this tasklet
can be RT>safely resumed and when scheduled will crash
RT>(perhaps something to do with the call stack where
RT>it blocked on the channel).
Juho, please see message
Subject: Re: [Stackless] Mistakes, Corrections and
Questions Concerning My Pickle Example Re: cPickles
hould work?
To: <stackless at stackless.com>
Message-ID:
<129CEF95A523704B9D46959C922A28000187AC50 at nemesis.central.ccp.cc>
Content-Type: text/plain; charset="iso-8859-1"
Yes, I am trying to pickle and unpickle tasklets. Some
of these processes themselves "contain" tasklets. The
"tasklet" group communicates through channels. The
conclusion I came to was that I could pickle the
"parent" tasklet and its children. Essentially the
problem is that Stackless did not allow me to remove
blocked tasklets.
>Pickling seems to be a powerfull tool but there's a
>lot of mysteries where I'm unable to find answers.
Yes, Juho, pickling is extremely powerful. I think the
best way to learn is to experiment and share
information. This way we can all move forward.
That said, I would like to see some explicit
channel.add(self, tasklet) and channel.remove(self,
tasklet) methods. However this may go against
Stackless's minimalist high level approach.
Cheers,
Andrew
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless
More information about the Stackless
mailing list