Skip to content

RFC: Cooperative concurrency model of choice for MicroPython #242

Closed
@pfalcon

Description

@pfalcon

This questions was raised yet in comments to Kickstarter campaign, and I'd like to set up this ticket for informal background discussion, to allow interested parties to further discuss/share ideas on this matter, and serve as guide for further implementation directions.

Summary of my proposal: Choose asynchronous concurrency via generators, as native, Pythonic, high-level way to do concurrency in Python.

I guess almost everyone heard that Python generators can be used to implement coroutines, and possibly few actually use them and up to date with their status. Myself neither, so I was taking last couple of weeks to survey state of the art in Python async concurrency in general, and generators in particular. There appear to be gradual advances since 2.5, and process continues, with upcoming 3.4 offering standardized async coroutine framework.

Formal references:

  1. http://www.python.org/dev/peps/pep-0342/ "Coroutines via Enhanced Generators"
  2. http://www.python.org/dev/peps/pep-0380/ "Syntax for Delegating to a Subgenerator"
  3. http://www.python.org/dev/peps/pep-3156/ "Asynchronous IO Support Rebooted: the "asyncio" Module"

Tutorials:
4. http://www.dabeaz.com/coroutines/index.html "A Curious Course on Coroutines and Concurrency"
5. http://lgiordani.github.io/blog/2013/03/29/python-generators-from-iterators-to-cooperative-multitasking-3/ "Python Generators - From Iterators to Cooperative Multitasking"

Reviews and comparisons:
6. http://nichol.as/asynchronous-servers-in-python "Asynchronous Servers in Python"

Metadata

Metadata

Assignees

No one assigned

    Labels

    rfcRequest for Comment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions