[Stackless] Is this me, or stackless?

Richard Tew richard.m.tew at gmail.com
Sat Jul 8 19:37:11 CEST 2006


On 7/8/06, Max Noel <maxfnoel at gmail.com> wrote:
> On 8 Jul 2006, at 18:55, Richard Tew wrote:
> >> I'm setting up several tasklets that listen on channels, and then
> >> issuing
> >> channel.send() messages from the main tasklet, without ever calling
> >> stackless.run().  Am I doing anything wrong here or is this a bug in
> >> stackless I should be investigating?
> >
> > Well, your tasklets are not all finishing, which is what is triggering
> > the problem when they are killed.  If you used stackless.run() that
> > would make it go away.  Definitely a bug.
> >
> > Any ideas about the best way to fix it?
> >
> > Richard.
>
> Depends... Is it a bug or a feature that tasklets can be awakened
> without stackless.run() having ever been called?

Feature.

I tried a preliminary fix, which was to make a main tasklet
and make it the current one before Stackless tried to kill all the
remaining ones, but tasklets seemed to be run rather than
killed.

void PyStackless_kill_tasks_with_stacks(int allthreads)
{
	PyThreadState *ts = PyThreadState_Get();

	initialize_main_and_current();
	slp_kill_tasks_with_stacks(allthreads ? NULL : ts);
}

Richard.

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list