[Stackless] bad version in CVS

Jeff Senn senn at maya.com
Mon Sep 23 22:48:04 CEST 2002


Christian Tismer <tismer at tismer.com> writes:
> I think it works, again.

Hm.  Are you sure?

I'm broken again... (crashing at random places).

I even did this -- instead of doing my normal
free-scheduling-of-tasklets-in-C hack -- I wrote the (near) equivalent
using run_watchdog:

# note this scheduler is probably not very "fair"
def free_schedule():
    r = stackless.run
    main = stackless.getcurrent()
    while 1:
      ##NOTE: I hacked .run to *NOT* remove the tasklet -- it
      ## just returns 1 if someone was interrupted 
      if r(100) == None:
          break
      else:
        t = main.next
        if not t.atomic:
           # put tasklet at end, let someone else run...
           t.remove()
           t.insert()  

...and this crashes too.  I'll try to track down the crashing -- I
think it does have something to do with multiple (real)
threads... maybe I'm doing something bad...

But -- are you sure you want to have stackless.run remove the
interrupted task?  Suppose it is atomic and really just wants to run a
bit to finish up? (If there was a way to insert it back at the *front*
of runnables that would be OK too ...)


-- 
-Jas   --------------------     www.maya.com
       Jeff Senn          |   / / |-/ \ / /|®
       Chief Technologist |  /|/| |/ o | /-|
       Head of R&D        | Taming Complexity®



More information about the Stackless mailing list