[Stackless] Documentation of tasklet life cycle (was Re: Open Stackless issues)

Anselm Kruis a.kruis at science-computing.de
Wed Sep 4 19:33:31 CEST 2013


Am 04.09.2013 18:18, schrieb Andrew Francis:
>>I just created a first draft of a state diagram for the tasklet life
>  >cycle. It is here:
>
>  >http://www.stackless.com/ticket/24#comment:11
>
>  >Any comments and suggestions are highly welcome.
>
> Nice work. Some comments:
>
> What is the difference between a tasklet that is not alive (i.e., not
> bound to a callable) and a tasklet that is not alive (but bounded to a
> callable). Should there be a dead state?
Good point. There is a transition missing from "Bound" to "Not alive" on 
tasklet.bind(None).


>
> Do you really need to distinguish between the "running" state and the
> "running in scheduler" state? Isn't the difference between
> stackless.run() and tasklet.run() a matter of when a tasklet is scheduled?

Good point. Indeed it is no longer necessary to distinguish these cases.

With previous versions of Stackless, calling stackless.schedule_remove() 
cause exceptions if the current tasklet was not scheduled. Obviously 
this has been fixed in between. I didn't notice that until I tried to 
reproduce the exception just now.

>
> Does a tasklet that is pickled or blocked on a channel require a special
> state (since a tasklet blocked on a channel cannot be pickled)?

Good point. I have no experience with channels at all. Obviously the 
diagram currently ignores tasklet.blocked, tasklet.restorable. And a 
pickled tasklet can be used to create an alive tasklet.

Next version is coming soon.


Cheers
   Anselm

-- 
  Dipl. Phys. Anselm Kruis                       science + computing ag
  Senior Solution Architect                      Ingolstädter Str. 22
  email A.Kruis at science-computing.de             80807 München, Germany
  phone +49 89 356386 874  fax 737               www.science-computing.de
-- 
Vorstandsvorsitzender/Chairman of the board of management:
Gerd-Lothar Leonhart
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Michael Heinrichs, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196




More information about the Stackless mailing list