[Stackless] pickling modules & stackless

lars van Gemerden lars at rational-it.com
Fri Jan 10 01:14:25 CET 2014


Thanks for the replies,

the presentation i mentioned was at:
https://ep2013.europython.eu/media/conference/slides/advanced-pickling-with-stackless-python-and-spickle.pdf

I'll look into the other replies tomorrow, it's late ..

Cheers, Lars


On Thu, Jan 9, 2014 at 12:11 PM, Christian Tismer <tismer at stackless.com>wrote:

> On 09.01.14 11:31, Anselm Kruis wrote:
>
>> Hi Lars,
>>
>> ...
>>
>> You wrote "the loaded model seems to use a pre-change class definition".
>> Probably you observe the following: if you pickle a tasklet, the tasklet
>> contains the list of frames on the stack. Each frame represents a running
>> function, but the frame does not reference the function object but the code
>> object of the function. Now code objects are always pickled by value. Upon
>> unpickling you get the old code objects. With other words, you can't
>> magically modify the code, that currently executes. Pickling code objects
>> by value is required, because local variables, cells, code and the
>> instruction pointer must be in an consistent state.
>>
>
> Well, Lars also asked
>
>
> """
> So my questions are, is this caused by stackless (compared to vanilla
> python) and if so, what triggers the pickling of modules and how can i
> influence that or use the vanilla version of pickle instead.
> """
>
> Because he considered to use the vanilla python pickling, I assumed
> that no tasklets are involved.
> That is a very special and known stackless feature.
>
> But maybe that is the bug, and there are unwanted references to tasklets
> in the model by chance. To avoid this, removing or running all tasklets
> to their end before pickling should help.
>
> cheers -- chris
>
>
> --
> Christian Tismer             :^)   <mailto:tismer at stackless.com>
> Software Consulting          :     Have a break! Take a ride on Python's
> Karl-Liebknecht-Str. 121     :    *Starship* http://starship.python.net/
> 14482 Potsdam                :     PGP key -> http://pgp.uni-mainz.de
> phone +49 173 24 18 776  fax +49 (30) 700143-0023
> PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
>       whom do you want to sponsor today?   http://www.stackless.com/
>
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless
>



-- 
====================================
Lars van Gemerden
lars at rational-it.com
+31 6 26 88 55 39
====================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20140110/605272df/attachment.html>


More information about the Stackless mailing list