Hi,
After reading this thread
http://www.stackless.com/pipermail/stackless/2009-September/004271.html, I
tried to enable hard switching for stackless samples. I encountered the
following error with "*Pickling and unpickling simple tasklets*" example:
Traceback (most recent call last):
File "/home/hcy/tmp/stackless_test.py", line 32, in <module>
schedule()
RuntimeError: cannot execute invalid frame with 'eval_frame_value': frame
had a C state that can't be restored.
--
Here the code I used:
from stackless import run, schedule, tasklet, enable_softswitch
import pickle
enable_softswitch(False)
def aCallable(name):
print " aCallable<%s>: Before schedule()" % (name,)
schedule()
print " aCallable<%s>: After schedule()" % (name,)
tasks = []
for name in "ABCDE":
tasks.append(tasklet(aCallable)(name))
print "Schedule 1:"
schedule()
print
print "Pickling..."
pickledTasks = pickle.dumps(tasks)
print
print "Schedule 2:"
schedule()
unpickledTasks = pickle.loads(pickledTasks)
for task in unpickledTasks:
task.insert()
print
print "Schedule Unpickled Tasks:"
schedule()
--
Is there a design incompatibility between "hard switching" and pickle ?
Herve
_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless