AW: Python and greenlets

  • From: Tim Bayer <timbayer0@xxxxxxxxxx>
  • To: "rumpkernel-users@xxxxxxxxxxxxx" <rumpkernel-users@xxxxxxxxxxxxx>
  • Date: Wed, 7 Sep 2016 18:06:56 +0000

I have tried it now. I think it already works correct.
The output of a direct python run and one with rumprun seems to be the same 
(12,56,34).
A other project where I want to use it seems to work too.
Thank you Ryan for greenlet support it is very usefull and a big help for me :)

________________________________
Von: rumpkernel-users-bounce@xxxxxxxxxxxxx 
<rumpkernel-users-bounce@xxxxxxxxxxxxx> im Auftrag von Antti Kantee 
<pooka@xxxxxx>
Gesendet: Mittwoch, 7. September 2016 14:44:41
An: rumpkernel-users@xxxxxxxxxxxxx
Betreff: Re: Python and greenlets

On 05/09/16 19:53, Ryan Day wrote:

Once the build is complete, greenlets is available as a builtin. The
example in examples/ almost works. I think the final "78" line is not being
printed even though it should be. This brings us to the discussion part,
and why I moved to the list :)

Looking at the code:

=== snip ===
def test1():
     print(12)
     gr2.switch()
     print(34)

def test2():
     print(56)
     gr1.switch()
     print(78)


gr1 = greenlet(test1)
gr2 = greenlet(test2)

if __name__ == '__main__':
     hello_world()
     gr1.switch()
=== snip ===

Ignoring hello_world(), I'd expect that program to output:

12
56
34

What is it actually printing?

Other related posts:

  • » AW: Python and greenlets - Tim Bayer