<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hello and thank you for your answer.That is what I thought after noticing the 0 runcount when called from the C API against the 1 runcount result from the called interpreter.Your answer clarifies what happens.<br>The only question I still have if it's desirable for the PyStackless_GetCurrent() to crash when there are not running tasklets.I don't know if there is any sane scenario in which it gets called while there are no running tasklets, but then again my experience lacks.<br>Cheers!<br><br>--- On <b>Wed, 19/1/11, Richard Tew <i><richard.m.tew@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Richard Tew <richard.m.tew@gmail.com><br>Subject: Re: [Stackless] Basic stackless embedding<br>To: "The Stackless Python Mailing List"
 <stackless@stackless.com><br>Date: Wednesday, 19 January, 2011, 1:41 AM<br><br><div class="plainMail">On Wed, Jan 19, 2011 at 12:30 AM, Andrew Macentire <<a ymailto="mailto:amacentire@ymail.com" href="/mc/compose?to=amacentire@ymail.com">amacentire@ymail.com</a>> wrote:<br>><br>> I am replying to my own thread.<br>> Doing a PyStackless_GetRunCount() shows that 0 tasklets are running and that explains why the st.current is in that state.However, I'm not sure crashing the whole application is the best way for PyStackless_GetCurrent() to behave.<br>> Also, what contributed to my confusion was that from the PyRun_Simplestring("print stackless.getcurrent()") the return value was 1.I guess I will look further today to see why exactly that is so.<br><br>When you execute "getcurrent" in Python, the Python interpreter is<br>running and a current tasklet is created as part of the process of it<br>doing so (this is actually the same as the
 main tasklet).  When you do<br>it from C, the Python interpreter is not running and there is none.<br>This is correct behaviour.<br><br>Cheers,<br>Richard.<br><br>_______________________________________________<br>Stackless mailing list<br><a ymailto="mailto:Stackless@stackless.com" href="/mc/compose?to=Stackless@stackless.com">Stackless@stackless.com</a><br><a href="http://www.stackless.com/mailman/listinfo/stackless" target="_blank">http://www.stackless.com/mailman/listinfo/stackless</a><br></div></blockquote></td></tr></table><br>