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