Steven D'Aprano <steve+pyt...@pearwood.info> writes: > How do I write work() so that it cooperatively multi-tasks with other ... > threads? processes? what the hell do we call these things? What does this > example become in the asynchronous world?
If it's heavily computational then you have to yield to the scheduler frequently so that other tasks have a chance to run. So if your 0.2 second computation involves 100 iterations of something, you could yield once per iteration (every 2 msec). -- https://mail.python.org/mailman/listinfo/python-list