[Stackless] Pickling example using Sieve of Eratosthenes

Andrew Francis andrewfr_ice at yahoo.com
Mon Nov 2 01:02:06 CET 2009

Hello Andrew:

--- On Sun, 11/1/09, Andrew Dalke <dalke at dalkescientific.com> wrote:

> def filter(prime, listen, send):
>     while (True):
>        i = listen.receive()
>        if (i % prime):
>           send.send(i)
> as
> def filter(prime, listen, send):
>     for i in listen:
>        if i % prime:
>           send.send(i)

Noted. I did this in the original version of the sieve that I illustrated
at the talk. Me bad. 

> I am having trouble making your demo work (after loading
> the image it still starts from the beginning), 

I just restarted a copy I stopped earlier at 1053301. I also seem to be able to start and restart the application under pypy-c. I am using 
Stackless Python 2.5.2 under Ubuntu 9.04 and pypy-c PyPy 1.1.0

>but I suspect that might be to my now years out of date Stackless.

Or you simply didn't do the following:

$python pickled-sieve.py filename i.e., sieve.dat

as per the comments? A case of RTFM :-)

That said, Andrew thank you for your suggestions. 



More information about the Stackless mailing list