[Stackless] Pickling and recursion

Kristján Valur Jónsson kristjan at ccpgames.com
Tue Oct 2 11:34:32 CEST 2012


Not necessarily.
the term "stackless" is historic in this respect.  Originally, the attempt was made to have pure python code work independently of the C stack.
In practice, this change was simply too big to be maintainable and so, nowadays, stackless does try to do this when possible, but otherwise relents.
Pickling in version 3 of python is by default done using C code, and C code normally also uses the c stack for recursion.

Two opposite caveats exists:
1) Stackless does attempt to mitigate C recursion by using "stack spilling" where very deep c invocation stacks are stored away on the heap.  This process is not foolproof and can become degenerated, but it is designed to work with regular python function invocation and pickling.
2) Python imposes its own recursion limit.  This has to be disabled to go very deep.  But again, this does not apply to c pickling.

So no, stackless python does not promise stackless python evaluation in the literal sense, but it might help you for very deep pickling.  Since it is not the primary purpose of Stackless, your mileage may vary.
K

> -----Original Message-----
> From: stackless-bounces at stackless.com [mailto:stackless-
> bounces at stackless.com] On Behalf Of Lars van Gemerden
> Sent: 1. október 2012 08:16
> To: stackless at stackless.com
> Subject: [Stackless] Pickling and recursion
> 
> Hello,
> 
> I was wandering whether using stackless also means that there is (practically)
> no limit to the recursion depth of highly recursive objects when using
> pickle/cPickle?
> 
> Cheers, Lars
> 
> ====================================
> Lars van Gemerden
> lars at rational-it.com
> +31 6 26 88 55 39
> ====================================
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless





More information about the Stackless mailing list