[Stackless] Proposal: new tasklet method set_args(*args, **kw) that combines setup() and remove()

Anselm Kruis a.kruis at science-computing.de
Mon Nov 18 11:39:25 CET 2013


Hi,

I propose to add a new method set_args(*args, **kw) to class tasklet, 
that combines

	stackless.setup(*args, **kw)
	stackless.remove()

Rationale: it is currently not possible to create an alive tasklet 
without scheduling it (except via unpickling or direct __setstate__).

With the new bind_thread() method, one can think of use cases where one 
thread creates tasklets and another thread executes them. No need to 
insert these tasklets into the current run queue. It could even cause races.

With set_args() in place, setup() would become a simple shortcut for 
set_args() followed by insert().

Does this proposal make sense?

regards
   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