Search.setIndex({"docnames": ["api", "c_api", "caveats", "changes", "contextvars", "creating_executing_greenlets", "development", "greenlet", "greenlet_gc", "gui_example", "history", "index", "python_threads", "switching", "tracing"], "filenames": ["api.rst", "c_api.rst", "caveats.rst", "changes.rst", "contextvars.rst", "creating_executing_greenlets.rst", "development.rst", "greenlet.rst", "greenlet_gc.rst", "gui_example.rst", "history.rst", "index.rst", "python_threads.rst", "switching.rst", "tracing.rst"], "titles": ["Python API Reference", "C API Reference", "Caveats and Known Issues", "Changes", "Context Variables (asyncio)", "Creating And Executing Greenlets", "Development Process", "greenlet Concepts", "Garbage Collection and greenlets", "Motivation: Treating an Asynchronous GUI Like a Synchronous Loop", "History And About", "greenlet: Lightweight concurrent programming", "Greenlets and Python Threads", "Switching Between Greenlets: Passing Objects and Control", "Tracing And Profiling"], "terms": {"greenletexit": [0, 1, 3, 5, 8, 13], "base": [0, 3, 9, 14], "baseexcept": [0, 3], "error": [0, 1, 3, 12], "getcurr": [0, 3, 4, 5, 7, 8, 9, 12], "return": [0, 1, 2, 3, 4, 5, 7, 8, 9, 13, 14], "current": [0, 1, 3, 4, 5, 11], "i": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 12, 13, 14], "e": [0, 3, 4, 11], "one": [0, 2, 3, 4, 7, 9, 11, 12, 13, 14], "which": [0, 3, 4, 7, 8, 9, 12, 13], "call": [0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14], "thi": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "function": [0, 3, 4, 5, 7, 8, 9, 10, 11, 13], "class": [0, 3, 5, 7, 8, 12, 14], "run": [0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14], "none": [0, 3, 4, 5, 7, 8, 12, 13], "parent": [0, 1, 3, 8, 9, 11, 13], "object": [0, 1, 3, 4, 5, 7, 8, 11, 12, 14], "creat": [0, 1, 3, 4, 6, 7, 8, 9, 11, 13], "new": [0, 1, 3, 4, 5, 8, 9, 14], "without": [0, 3, 8, 9, 11], "The": [0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 13, 14], "callabl": [0, 1], "invok": [0, 3, 9], "default": [0, 3, 4, 5, 7], "support": [0, 4, 10, 11, 14], "boolean": 0, "test": [0, 3], "bool": 0, "g": [0, 1, 3, 13], "true": [0, 1, 5, 7, 8, 9, 12], "activ": [0, 1, 3, 4, 7, 8], "fals": [0, 7], "dead": [0, 3, 4, 7, 8, 9, 11, 12], "yet": [0, 3, 4, 9, 13], "start": [0, 1, 3, 4, 7, 9, 12, 13], "switch": [0, 1, 2, 3, 4, 5, 8, 11, 12, 14], "arg": [0, 1, 13, 14], "kwarg": [0, 1, 13], "execut": [0, 7, 8, 9, 11, 13], "see": [0, 2, 3, 5, 10, 11], "between": [0, 5, 7, 9, 11, 12], "pass": [0, 1, 3, 5, 7, 9, 11, 12, 14], "control": [0, 4, 5, 7, 8, 9, 10, 11], "throw": [0, 3, 11, 13, 14], "immedi": [0, 1, 9, 13], "rais": [0, 1, 3, 4, 13], "given": [0, 1, 13], "If": [0, 1, 4, 5, 8, 11, 12, 13], "argument": [0, 1, 3, 5, 9, 11], "provid": [0, 1, 3, 10, 11, 13], "normal": [0, 13], "propag": [0, 5, 7, 13], "rule": [0, 13], "appli": [0, 3], "describ": [0, 2, 13], "note": [0, 1, 3, 6, 7, 8, 9, 13, 14], "method": [0, 3, 5, 8, 13, 14], "almost": [0, 4], "equival": 0, "follow": [0, 9, 14], "def": [0, 4, 5, 7, 8, 9, 11, 12, 13, 14], "raiser": 0, "typ": [0, 1], "val": [0, 1, 7], "tb": [0, 1], "g_raiser": 0, "trick": 0, "doe": [0, 3, 4, 6, 7, 8, 13], "work": [0, 3, 7, 9, 11, 14], "would": [0, 3, 4, 7], "from": [0, 1, 3, 4, 7, 8, 9, 11, 12, 13, 14], "finish": [0, 5, 7, 13], "its": [0, 1, 3, 4, 5, 7, 8, 9, 11, 13], "gr_context": [0, 3, 4], "contextvar": [0, 3, 4, 9], "context": [0, 3, 9, 11, 14], "writabl": 0, "reflect": [0, 4], "an": [0, 1, 2, 3, 4, 5, 7, 8, 11, 12, 13], "empti": [0, 1, 4, 7, 13], "unless": [0, 13], "told": 0, "otherwis": 0, "gener": [0, 3, 7, 8, 9, 10, 11], "should": [0, 3, 12], "onli": [0, 3, 4, 7, 8, 9, 13, 14], "set": [0, 1, 3, 4, 5, 9, 12, 13], "onc": [0, 1, 4, 9], "befor": [0, 3, 4, 7], "begin": [0, 5, 7, 8], "access": [0, 4], "modifi": [0, 4], "attribut": [0, 3, 4, 5, 7, 8], "attributeerror": [0, 1, 5], "version": [0, 3, 4, 6, 10], "3": [0, 4, 7, 8], "6": 0, "earlier": [0, 3, 4], "don": [0, 3, 7, 8, 9, 10], "t": [0, 2, 3, 4, 7, 8, 10, 12, 13, 14], "nativ": [0, 3, 4, 9, 11], "modul": [0, 1, 3, 7, 10, 11, 14], "wa": [0, 2, 3, 4, 5, 7, 9, 11, 12, 13, 14], "built": [0, 3, 5, 10, 11], "For": [0, 3, 4, 7, 9, 10, 11, 12, 13, 14], "more": [0, 2, 3, 5, 7, 9, 10, 11], "inform": [0, 3, 5, 13], "variabl": [0, 2, 3, 8, 9, 11], "asyncio": [0, 9, 11], "1": [0, 1, 4, 7, 8, 9, 11, 13], "0": [0, 1, 4, 7, 12], "gr_frame": 0, "frame": [0, 2, 7, 14], "when": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "most": [0, 3, 5, 7, 9, 12], "recent": [0, 3, 5, 7, 12], "some_other_greenlet": 0, "resum": [0, 5, 7, 9, 13], "this_greenlet": 0, "next": [0, 9], "remaind": 0, "": [0, 1, 2, 3, 4, 7, 8, 9, 10, 11, 12, 13, 14], "stack": [0, 2, 3, 4, 7, 9, 11, 14], "can": [0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14], "f_back": 0, "non": [0, 1, 3, 4], "suspend": [0, 4, 7, 9, 12, 13], "allow": [0, 3, 7, 9], "cycl": [0, 5, 12], "A": [0, 1, 4, 7, 10, 11, 13], "main": [0, 2, 3, 5, 8, 9, 11, 12, 13], "thread": [0, 2, 3, 4, 7, 9, 10, 11, 14], "cannot": [0, 3, 12], "anyth": 0, "after": [0, 3, 4, 9, 13], "longer": [0, 3], "exist": [0, 3, 11], "subclass": [0, 3, 7, 11], "defin": [0, 3, 4, 5, 7, 8, 9, 11, 14], "type": [0, 9], "detail": [0, 3, 7, 12], "And": [0, 7, 11], "profil": [0, 3, 11], "gettrac": [0, 14], "settrac": [0, 3, 14], "callback": [0, 9], "previou": [0, 3, 14], "paramet": [0, 1, 14], "signatur": [0, 3, 14], "event": [0, 11, 12, 14], "greenlet": [1, 3, 4, 6, 14], "manipul": 1, "extens": [1, 3, 10], "written": 1, "applic": [1, 3, 9], "emb": [1, 3], "python": [1, 3, 4, 6, 8, 9, 10, 11, 13, 14], "h": [1, 3], "header": [1, 3], "expos": [1, 3], "entir": [1, 11, 13], "avail": [1, 3, 10], "pure": [1, 3], "much": [1, 2, 9], "implement": [1, 3, 9, 11, 12], "term": 1, "macro": [1, 3], "mean": [1, 3, 9, 11, 13], "necessarili": 1, "abi": [1, 3, 6], "stabl": [1, 3], "pygreenlet": 1, "name": [1, 3, 7, 14], "correspond": 1, "pyexc_greenleterror": 1, "pyexc_greenletexit": 1, "void": 1, "pygreenlet_import": 1, "import": [1, 3, 4, 5, 7, 8, 9, 12, 13, 14], "initi": [1, 4, 5, 7], "must": [1, 2, 3, 4, 5, 7, 14], "each": [1, 4, 9, 12], "us": [1, 3, 4, 5, 6, 8, 9, 11, 12, 13, 14], "usual": [1, 11, 13], "init": 1, "int": 1, "pygreenlet_check": 1, "pyobject": 1, "p": 1, "pygreenlet_start": 1, "ha": [1, 3, 4, 7, 9, 11, 12, 13], "pygreenlet_act": 1, "di": [1, 7, 12, 13], "pygreenlet_getpar": [1, 3], "null": 1, "pointer": 1, "you": [1, 3, 4, 5, 7, 9, 10, 11, 12, 13], "decrement": 1, "pygreenlet_setpar": [1, 3], "nparent": 1, "success": 1, "been": [1, 3, 9, 12], "pygreenlet_getcurr": 1, "pygreenlet_new": 1, "both": [1, 3, 7, 8, 9], "ar": [1, 3, 5, 6, 9, 10, 11, 12, 13, 14], "option": 1, "mai": [1, 2, 3, 4, 7, 8, 12], "fail": [1, 3], "automat": [1, 8], "pygreenlet_switch": 1, "besid": [1, 5], "remain": [1, 3], "tupl": [1, 13, 14], "target": [1, 13, 14], "keyword": [1, 3, 9, 10, 11], "dict": [1, 13], "pygreenlet_throw": [1, 3], "valu": [1, 4, 7, 9, 10, 13], "traceback": [1, 5, 7, 12], "interpret": [1, 3, 9, 10, 11], "pyerr_restor": 1, "document": [2, 3, 5, 6, 9, 10], "sharp": 2, "edg": 2, "includ": [2, 3, 6, 8], "c": [2, 3, 9, 10, 11, 12], "like": [2, 3, 4, 8, 11], "librari": [2, 7, 10, 11], "than": [2, 3, 11], "attempt": [2, 12, 13], "enter": [2, 4, 11, 13], "subtl": 2, "problem": [2, 3, 9], "result": [2, 3, 9, 13], "common": [2, 3], "construct": 2, "reentrant": 2, "static": 2, "global": [2, 11], "sourc": [2, 3, 10], "gevent": [2, 3, 5, 10, 11], "led": 2, "corrupt": [2, 3], "libuv": [2, 11], "intern": [2, 3, 9], "state": [2, 3, 4, 5, 9, 12, 14], "fix": 2, "avoid": [2, 11], "vulner": 2, "In": [2, 3, 5, 9, 11, 12, 14], "cpython": [2, 3, 10, 11], "order": [2, 9, 11], "rest": [2, 11], "program": [2, 3, 8, 9, 10], "proce": [2, 11], "exampl": [2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14], "get": [2, 4, 7, 9], "back": [2, 7, 8, 9, 13], "doesn": [2, 4, 7, 8, 9, 14], "realli": 2, "lead": [2, 3, 8], "hang": 2, "143": 2, "same": [3, 4, 8, 11, 14], "tracer": 3, "issu": [3, 9, 11], "332": 3, "variou": 3, "compil": 3, "standard": [3, 14], "conform": 3, "335": 3, "336": 3, "300": 3, "302": 3, "334": 3, "memori": [3, 8, 12], "leak": [3, 12], "328": 3, "1924": 3, "add": 3, "languag": [3, 11, 13], "pypi": [3, 6, 10], "classifi": 3, "metadata": 3, "noth": 3, "linux": [3, 6], "anoth": [3, 4, 7, 9, 12, 13], "group": 3, "rare": 3, "crash": 3, "could": [3, 7, 9], "occur": [3, 4, 13], "shut": 3, "down": 3, "interpet": 3, "multipl": [3, 11], "325": 3, "some": [3, 5, 12, 13], "those": [3, 7, 11, 12, 13, 14], "make": [3, 4, 9, 10, 12], "releas": [3, 11], "gil": [3, 11], "old": 3, "style": [3, 8, 11], "instanc": [3, 5], "workaround": 3, "bug": [3, 11], "caus": [3, 7], "dure": [3, 13], "earli": 3, "phase": 3, "shutdown": 3, "messag": [3, 12], "fatal": 3, "alloc": 3, "hold": [3, 4], "gi": 3, "impact": 3, "8a3": 3, "through": 3, "9a5": 3, "pleas": 3, "alpha": 3, "deal": 3, "gracefulli": 3, "while": [3, 8, 9, 13], "defer": 3, "dealloc": 3, "happen": [3, 12, 14], "trash": 3, "mechan": [3, 9], "previous": [3, 13], "larg": 3, "nest": [3, 10, 13], "contain": [3, 7, 12], "held": [3, 8], "item": 3, "delai": 3, "second": [3, 5, 9, 13], "also": [3, 4, 5, 7, 8, 9, 11], "becom": [3, 4, 7, 8], "visibl": 3, "assert": 3, "debug": [3, 14], "build": [3, 10, 11], "now": [3, 4, 9, 13], "relev": 3, "save": 3, "restor": [3, 14], "1909": 3, "renam": 3, "api": [3, 11, 14], "pygreenlet_get_par": 3, "consist": 3, "deprec": 3, "alia": 3, "older": [3, 4], "window": [3, 6, 9], "runtim": [3, 12], "unhandl": 3, "except": [3, 4, 8, 11, 13, 14], "thrown": [3, 5], "insid": [3, 4], "still": [3, 9, 10, 12, 13], "abort": 3, "least": 3, "so": [3, 4, 7, 8, 9, 13, 14], "deliber": 3, "thank": 3, "kiril": 3, "smelkov": 3, "pr": 3, "286": 3, "musllinux": 3, "wheel": [3, 6], "aarch64": [3, 6], "upload": [3, 6], "alexand": 3, "piskun": 3, "known": [3, 11], "0a6": 3, "later": [3, 5, 13], "294": 3, "special": [3, 5, 11, 13], "victor": 3, "stinner": 3, "brandt": 3, "bucher": 3, "develop": [3, 11], "experiment": 3, "untest": 3, "64": 3, "bit": 3, "arm": 3, "msvc": 3, "271": 3, "drop": 3, "veri": [3, 14], "gcc": 3, "requir": [3, 8, 11], "either": [3, 5, 8], "other": [3, 5, 7, 8, 9, 10, 11, 13], "intrins": 3, "wai": [3, 5, 7, 8, 9, 10, 13, 14], "local": [3, 4], "clang": 3, "sunstudio": 3, "we": [3, 7, 8, 9, 10, 13, 14], "__thread": 3, "__declspec": 3, "compat": [3, 14], "specif": 3, "x86_64": [3, 6], "retroact": 3, "done": [3, 7, 14], "well": [3, 8, 11], "0a4": 3, "280": 3, "sever": [3, 10], "necessari": 3, "exit": [3, 4, 5, 9, 12], "clean": [3, 8], "up": [3, 8, 13], "252": 3, "perform": 3, "check": 3, "did": [3, 13], "handl": [3, 14], "32": 3, "might": [3, 4, 9], "have": [3, 4, 5, 7, 8, 9, 11, 12, 13, 14], "ramif": 3, "your": [3, 10, 11], "seh": 3, "contact": 3, "maintain": [3, 9], "area": 3, "expect": [3, 5, 8, 14], "better": 3, "ongo": 3, "repr": 3, "particular": [3, 8], "indic": 3, "part": [3, 9], "reli": [3, 12], "upon": [3, 4, 12], "product": 3, "code": [3, 7, 9, 10, 11, 14], "It": [3, 4, 8, 9, 12, 14], "differ": [3, 4, 5, 7, 8, 9, 10, 11, 12], "mark": 3, "alpin": 3, "binari": [3, 6, 10], "preliminari": 3, "upgrad": 3, "re": [3, 5, 8, 9, 11, 14], "time": [3, 4, 5, 7, 8, 11, 13], "potenti": [3, 4, 12, 14], "due": 3, "refer": [3, 8, 12], "count": 3, "were": [3, 4], "becam": 3, "silent": 3, "245": 3, "patch": 3, "fygao": 3, "wish": 3, "list": 3, "last": [3, 4, 5, 7, 8, 12, 13], "delet": [3, 5, 8], "belong": [3, 12], "correctli": 3, "own": [3, 4, 9, 10, 11, 13], "long": [3, 7], "stand": 3, "limit": [3, 8, 11], "hope": 3, "lift": 3, "case": [3, 5, 8, 9, 12, 13, 14], "themselv": [3, 8], "251": 3, "trace": [3, 11], "spawn": [3, 4, 5, 13], "didn": 3, "256": 3, "report": 3, "joe": 3, "rickerbi": 3, "updat": [3, 9], "against": 3, "10rc1": 3, "where": [3, 4, 7, 8, 9, 13], "pre": 3, "all": [3, 4, 8, 9, 11, 12, 13], "never": [3, 7, 9, 13], "consid": [3, 6, 9, 12], "reason": [3, 4, 12], "major": [3, 6, 11], "r": 3, "format": 3, "unicod": 3, "string": [3, 14], "instead": [3, 4, 5, 14], "218": 3, "move": 3, "continu": [3, 7, 9, 11], "integr": [3, 11], "travi": 3, "ci": 3, "github": [3, 10], "action": 3, "abil": 3, "pep": [3, 4], "567": [3, 4], "directli": [3, 7], "assign": [3, 4, 5], "pattern": [3, 11], "atop": 3, "async": [3, 9, 11], "environ": [3, 4, 11], "challeng": [3, 4], "joshua": 3, "oreman": 3, "mike": 3, "bayer": 3, "fantix": 3, "king": 3, "among": [3, 8], "198": 3, "extra": 3, "about": [3, 5, 6, 7, 9, 11], "subject": 3, "215": 3, "There": [3, 10], "undocu": 3, "greenlet_vers": 3, "give": [3, 8, 9], "publish": 3, "log": 3, "http": [3, 6, 10], "readthedoc": [3, 10], "io": [3, 10, 11], "project": [3, 10], "python_requir": 3, "data": [3, 8, 10], "help": 3, "instal": [3, 6, 10, 14], "tool": 3, "understand": 3, "partial": 3, "aix": 3, "ppc64": 3, "ibm": 3, "jess": 3, "gorzinski": 3, "kevin": 3, "adler": 3, "197": 3, "setuptool": 3, "stop": [3, 9], "ask": [3, 13], "tar": 3, "gz": 3, "zip": 3, "sdist": 3, "custom": [3, 10], "distutil": 3, "command": [3, 6, 9], "remov": [3, 8], "setup": 3, "py": [3, 10], "favorit": 3, "unittest": 3, "runner": 3, "m": 3, "discov": 3, "185": 3, "directori": 3, "layout": 3, "184": 3, "alwai": 3, "garbag": [3, 7, 11, 12], "collect": [3, 6, 7, 11, 12], "abov": [3, 4, 6, 7, 9, 11, 13], "preprocessor": 3, "alter": 3, "combin": [3, 12], "ever": [3, 7, 8], "dec": 3, "architectur": 3, "10a0": 3, "risc": 3, "v": 3, "sky": 3, "mingw": 3, "x64": 3, "trashcan": 3, "ad": 3, "miss": 3, "file": [3, 7], "manifest": 3, "ppc32": 3, "manylinux1": 3, "arm32": 3, "ppc64le": 3, "mip": 3, "sparc": 3, "_stack_sav": 3, "properti": [3, 12], "introspect": 3, "amount": 3, "futur": [3, 13], "optim": 3, "typo": [3, 7], "multi": 3, "itself": [3, 8, 9, 13], "spuriou": 3, "boonsnaibot": 3, "depend": [3, 9], "wrong": 3, "dll": 3, "slp_switch": 3, "fno": 3, "tree": [3, 7, 12], "domin": 3, "opt": 3, "enabl": [3, 4, 8], "suno": 3, "abc": 3, "abstract": [3, 11], "yml": 3, "err": 3, "uniniti": 3, "_msc_ver": 3, "m68k": 3, "segfault": 3, "amd64": 3, "x86": 3, "unix": 3, "try": [3, 5, 8, 9], "disabl": 3, "certain": 3, "sun4v": 3, "x32": 3, "psabi": 3, "constraint": 3, "assembli": 3, "ppc": 3, "dictionari": 3, "storag": [3, 4], "etc": [3, 7], "howev": [3, 4, 10, 11, 12], "introduc": [3, 8, 9], "incompat": [3, 9], "__dict__": [3, 7], "__slots__": 3, "becaus": [3, 4, 8, 11, 12], "alreadi": 3, "out": [3, 7], "box": 3, "termin": [3, 11, 13], "left": [3, 8], "debian": 3, "openbsd5": 3, "sparc64": 3, "copi": [3, 4], "deepcopi": 3, "thumb": 3, "kill": [3, 7], "plain": 3, "enhanc": 3, "s390": 3, "zseri": 3, "rhel": 3, "cento": 3, "sphinx": 3, "rtfd": 3, "org": [3, 10], "prevent": [3, 11], "openbsd": 3, "i386": 3, "clobber": 3, "rbx": 3, "infrastructur": 3, "possibl": [3, 4, 12], "mode": 3, "solari": 3, "vc90": 3, "store": [3, 5, 8], "threadstat": 3, "stackless": [3, 10], "do": [3, 4, 8, 9, 12], "pycapsul": 3, "port": 3, "powerpc": 3, "improv": [3, 14], "flub": 3, "21": 3, "rudimentari": 3, "gc": [3, 8], "live": 3, "though": [3, 9], "mbachri": 3, "accept": [3, 9], "crasher": 3, "vs2009": 3, "arigo": 3, "sylvain": 3, "baro": 3, "thiemo": 3, "seufer": 3, "minggw": 3, "giovanni": 3, "bajo": 3, "40": 3, "lib": 3, "ghazel": 3, "load": 3, "unit": 3, "mani": [3, 9, 11], "repositori": [3, 6, 10], "cleanup": 3, "kyle": 3, "ambroff": 3, "jare": 3, "kuolt": 3, "On": 4, "7": 4, "need": [4, 9, 10], "match": 4, "behavior": 4, "task": [4, 11], "inherit": 4, "chang": [4, 6, 7, 9, 11, 12], "set_it": 4, "next_valu": 4, "previous_valu": 4, "print": [4, 5, 7, 8, 9, 13, 14], "_": [4, 5, 8, 12, 14], "By": [4, 9], "unrel": [4, 13], "gr1": [4, 7, 13], "2": [4, 7, 8, 12], "gr2": [4, 7, 13], "copy_context": 4, "share": 4, "awar": [4, 9], "gr3": 4, "altern": [4, 9, 10], "surround": 4, "top": [4, 7, 8, 9, 10], "level": [4, 7, 8, 9, 10, 11], "gr4": 4, "design": 4, "mind": 4, "arbitrari": [4, 7], "transfer": [4, 7, 14], "across": 4, "effect": [4, 9, 11], "form": 4, "first": [4, 7, 9, 13], "two": [4, 9, 11, 14], "restrict": 4, "matter": 4, "what": [4, 8, 11, 14], "ani": [4, 5, 7, 8, 9, 11, 13, 14], "valueerror": [4, 5], "begun": [4, 13], "recommend": [4, 6], "outlin": 4, "below": [4, 7], "track": 4, "right": 4, "One": [4, 9], "repres": [4, 7], "implicitli": 4, "them": [4, 7, 9], "some_inn": 4, "func": 4, "until": [4, 9], "entri": 4, "safest": 4, "thing": [4, 9], "conflict": 4, "To": [5, 11], "simpli": [5, 9], "instanti": 5, "framework": [5, 9, 11], "consult": 5, "prefer": 5, "glet": [5, 7, 8], "addit": [5, 9, 11, 12], "mygreenlet": 5, "created_at": 5, "finished_at": 5, "self": [5, 8, 12, 14], "creation": 5, "desir": [5, 9, 11], "child_result": 5, "parent_glet": 5, "child": 5, "child_glet": [5, 12], "Of": [5, 9, 14], "cours": [5, 9, 14], "permit": 5, "cyclic": [5, 8], "chain": 5, "42": [5, 13], "typeerror": 5, "loop": [5, 8, 11], "myexcept": 5, "caught": [5, 13], "uncaught": 5, "As": [5, 7, 13], "commonli": 5, "signal": 5, "how": [6, 8, 9, 11, 13], "primari": 6, "locat": 6, "com": [6, 10], "semant": 6, "break": [6, 9, 13], "made": 6, "zest": 6, "pip": [6, 10], "fullreleas": 6, "maco": 6, "tag": 6, "push": [6, 9], "small": 7, "independ": [7, 12], "pseudo": [7, 10], "think": [7, 11], "outermost": 7, "bottom": 7, "innermost": 7, "paus": 7, "These": [7, 8], "few": [7, 10], "user": [7, 9], "gr_": 7, "reserv": 7, "number": [7, 13], "jump": [7, 9, 13], "implicit": [7, 9, 10], "choos": 7, "former": 7, "latter": 7, "similarli": [7, 13], "send": [7, 9, 13], "go": [7, 8], "specifi": 7, "eventu": 7, "again": [7, 12, 13], "die": [7, 8], "let": [7, 8, 9], "quickli": [7, 9], "pull": [7, 9], "togeth": [7, 9], "demonstr": [7, 8, 9], "test1": [7, 13], "test2": [7, 13], "line": [7, 9], "At": 7, "point": [7, 13], "come": [7, 9], "origin": [7, 9, 14], "final": [7, 8, 13], "seen": 7, "obtain": 7, "explicitli": [7, 8, 9], "everi": 7, "process": [7, 8, 9, 10, 11], "am_i_main": 7, "being": 7, "organ": 7, "root": 7, "whether": 7, "fall": [7, 8], "off": [7, 10], "end": 7, "whenev": 7, "too": [7, 10], "nameerror": 7, "show": 7, "rememb": 7, "parallel": [7, 11], "logic": [7, 9], "this_should_be_a_name_error": 7, "doctest": 7, "awai": 8, "receiv": [8, 13], "asynchron": [8, 11], "explicit": 8, "block": [8, 9], "chanc": 8, "resourc": [8, 11], "featur": [8, 11], "infinit": [8, 11], "wait": [8, 9, 12], "Such": 8, "interrupt": [8, 11], "goe": [8, 13], "got": [8, 9, 13], "quit": [8, 9], "resurrect": 8, "somewher": 8, "just": [8, 9, 13], "catch": 8, "ignor": [8, 9], "particip": 8, "fashion": [8, 9], "involv": [8, 11], "present": 8, "detect": [8, 12, 14], "__del__": 8, "thei": [8, 9, 11], "won": 8, "here": [8, 9, 13, 14], "found": 8, "even": [8, 9, 11], "find": 8, "collect_it": 8, "cycle1": 8, "cycle2": 8, "var": 8, "del": 8, "tweak": 8, "apart": [8, 13], "within": 8, "outer": [8, 13], "inner": [8, 13], "outer_glet": [8, 13], "freed": 8, "leav": 8, "child_greenlet": 8, "hidden": 8, "legitim": 8, "ll": 9, "connect": 9, "oper": [9, 11], "race": [9, 11, 12], "condit": [9, 11, 12], "transform": [9, 11], "consol": 9, "structur": [9, 10], "similar": [9, 11, 14], "techniqu": 9, "xml": 9, "expat": 9, "parser": 9, "system": [9, 11], "assum": 9, "input": 9, "charact": 9, "typic": [9, 10], "echo_user_input": 9, "user_input": 9, "strip": 9, "process_command": 9, "endswith": 9, "n": 9, "read_next_char": 9, "sure": 9, "y": [9, 13], "job": 9, "accumul": 9, "heart": 9, "around": [9, 13], "sy": [9, 14], "stdin": 9, "someth": [9, 14], "complex": 9, "curs": 9, "getch": 9, "kei": 9, "want": [9, 10], "plug": 9, "toolkit": 9, "wrote": 9, "press": 9, "event_keydown": 9, "difficult": [9, 14], "notifi": 9, "stress": 9, "fact": [9, 12], "our": [9, 10, 13], "But": 9, "fit": 9, "suppos": 9, "middl": 9, "deliveri": 9, "complic": 9, "rather": 9, "solut": 9, "relat": [9, 11], "lock": [9, 11], "commun": 9, "singl": [9, 10, 11, 13], "pretti": 9, "cool": 9, "cooler": 9, "g_processor": 9, "arrang": 9, "u": [9, 13], "main_greenlet": 9, "side": 9, "coin": 9, "next_char": 9, "hand": [9, 10], "over": 9, "fake": 9, "feed": 9, "purpos": [9, 11], "gui_mainloop": 9, "hello": [9, 13], "respond": 9, "prompt": 9, "notic": 9, "successfulli": 9, "forth": 9, "caller": 9, "author": 9, "contrast": [9, 11], "await": 9, "often": [9, 11], "spread": 9, "throughout": 9, "codebas": 9, "put": [9, 13], "halt": 9, "interact": 9, "flow": [9, 10, 11], "wherev": 9, "instruct": 9, "preserv": 9, "posit": [9, 13], "kept": 9, "nice": 9, "complet": [9, 11], "rewrit": 9, "turn": [9, 13], "machin": 9, "concept": [9, 11], "curiou": 9, "footnot": [9, 11], "safe": 9, "queue": [9, 11], "exchang": [9, 10], "keypress": 9, "write": [9, 11], "d": 9, "significantli": 9, "diverg": 9, "lightweight": 10, "coroutin": [10, 11], "concurr": 10, "packag": 10, "spin": 10, "micro": 10, "tasklet": 10, "o": [10, 11], "synchron": [10, 11], "channel": 10, "primit": 10, "notion": 10, "schedul": [10, 11], "word": 10, "exactli": 10, "seem": 10, "advanc": 10, "recreat": 10, "yield": [10, 11], "addition": 10, "test_gener": 10, "regular": 10, "unmodifi": 10, "flexibl": 10, "eventlet": 10, "easiest": 10, "archiv": 10, "distribut": 10, "index": [10, 11], "host": 10, "page": 11, "piqu": 11, "interest": 11, "read": 11, "gui": 11, "simpl": 11, "motiv": 11, "treat": 11, "app": 11, "compet": 11, "dual": 11, "further": 11, "lifecycl": 11, "histori": 11, "caveat": 11, "sequenti": 11, "frequent": 11, "higher": 11, "analogi": 11, "section": 11, "explor": 11, "precis": [11, 13], "introduct": 11, "cooper": 11, "sinc": [11, 13, 14], "theori": 11, "preemptiv": 11, "imposs": 11, "sai": 11, "necessit": 11, "care": 11, "approach": 11, "deadlock": 11, "programm": 11, "fulli": 11, "elimin": 11, "greatli": 11, "simplifi": 11, "bookkeep": 11, "kernel": 11, "fewer": 11, "practic": 11, "els": [11, 14], "polici": 11, "suit": 11, "libev": 11, "familiar": 11, "appar": 11, "driven": 11, "three": 11, "unlik": 11, "capabl": 11, "wherea": 11, "thu": 11, "search": 11, "sub": 12, "mix": 12, "main_glet": 12, "lambda": 12, "join": 12, "prior": 12, "observ": 12, "platform": 12, "guarante": 12, "uncollect": 12, "keep": 12, "aliv": 12, "best": 12, "take": 12, "caution": 12, "carefulli": 12, "manag": 12, "lifetim": 12, "referenc": 12, "row": 12, "clear": 12, "whose": 13, "sent": 13, "conveni": 13, "x": 13, "z": 13, "world": 13, "someon": 13, "dy": 13, "inde": 13, "although": 13, "appear": 13, "hasn": 13, "element": 13, "str": [13, 14], "en": 13, "howdi": 13, "en_u": 13, "en_us_ok": 13, "actual": 13, "inner_glet": 13, "wind": 13, "reliabl": 14, "convent": 14, "unpack": 14, "extend": 14, "replac": 14, "__str__": 14, "old_trac": 14}, "objects": {"": [[1, 0, 1, "c.PyExc_GreenletError", "PyExc_GreenletError"], [1, 0, 1, "c.PyExc_GreenletExit", "PyExc_GreenletExit"], [1, 0, 1, "c.PyGreenlet", "PyGreenlet"], [1, 1, 1, "c.PyGreenlet_ACTIVE", "PyGreenlet_ACTIVE"], [1, 1, 1, "c.PyGreenlet_Check", "PyGreenlet_Check"], [1, 1, 1, "c.PyGreenlet_GetCurrent", "PyGreenlet_GetCurrent"], [1, 1, 1, "c.PyGreenlet_GetParent", "PyGreenlet_GetParent"], [1, 1, 1, "c.PyGreenlet_Import", "PyGreenlet_Import"], [1, 1, 1, "c.PyGreenlet_New", "PyGreenlet_New"], [1, 1, 1, "c.PyGreenlet_STARTED", "PyGreenlet_STARTED"], [1, 1, 1, "c.PyGreenlet_SetParent", "PyGreenlet_SetParent"], [1, 1, 1, "c.PyGreenlet_Switch", "PyGreenlet_Switch"], [1, 1, 1, "c.PyGreenlet_Throw", "PyGreenlet_Throw"]], "PyGreenlet_ACTIVE": [[1, 2, 1, "c.PyGreenlet_ACTIVE", "g"]], "PyGreenlet_Check": [[1, 2, 1, "c.PyGreenlet_Check", "p"]], "PyGreenlet_GetParent": [[1, 2, 1, "c.PyGreenlet_GetParent", "g"]], "PyGreenlet_New": [[1, 2, 1, "c.PyGreenlet_New", "parent"], [1, 2, 1, "c.PyGreenlet_New", "run"]], "PyGreenlet_STARTED": [[1, 2, 1, "c.PyGreenlet_STARTED", "g"]], "PyGreenlet_SetParent": [[1, 2, 1, "c.PyGreenlet_SetParent", "g"], [1, 2, 1, "c.PyGreenlet_SetParent", "nparent"]], "PyGreenlet_Switch": [[1, 2, 1, "c.PyGreenlet_Switch", "args"], [1, 2, 1, "c.PyGreenlet_Switch", "g"], [1, 2, 1, "c.PyGreenlet_Switch", "kwargs"]], "PyGreenlet_Throw": [[1, 2, 1, "c.PyGreenlet_Throw", "g"], [1, 2, 1, "c.PyGreenlet_Throw", "tb"], [1, 2, 1, "c.PyGreenlet_Throw", "typ"], [1, 2, 1, "c.PyGreenlet_Throw", "val"]], "greenlet": [[0, 3, 1, "", "GreenletExit"], [0, 3, 1, "", "error"], [0, 4, 1, "", "getcurrent"], [0, 4, 1, "", "gettrace"], [0, 5, 1, "", "greenlet"], [0, 4, 1, "", "settrace"]], "greenlet.greenlet": [[0, 6, 1, "", "dead"], [0, 6, 1, "", "gr_context"], [0, 6, 1, "", "gr_frame"], [0, 6, 1, "", "parent"], [0, 6, 1, "", "run"], [0, 7, 1, "", "switch"], [0, 7, 1, "", "throw"]]}, "objtypes": {"0": "c:type", "1": "c:function", "2": "c:functionParam", "3": "py:exception", "4": "py:function", "5": "py:class", "6": "py:attribute", "7": "py:method"}, "objnames": {"0": ["c", "type", "C type"], "1": ["c", "function", "C function"], "2": ["c", "functionParam", "C function parameter"], "3": ["py", "exception", "Python exception"], "4": ["py", "function", "Python function"], "5": ["py", "class", "Python class"], "6": ["py", "attribute", "Python attribute"], "7": ["py", "method", "Python method"]}, "titleterms": {"python": [0, 12], "api": [0, 1], "refer": [0, 1, 11], "except": [0, 1, 5, 7], "greenlet": [0, 2, 5, 7, 8, 9, 10, 11, 12, 13], "trace": [0, 14], "c": 1, "type": 1, "function": [1, 2, 14], "caveat": 2, "known": 2, "issu": 2, "nativ": 2, "should": 2, "Be": 2, "re": 2, "entrant": 2, "us": [2, 10], "caution": 2, "mix": 2, "signal": 2, "handler": 2, "chang": [3, 5], "2": 3, "0": 3, "2023": 3, "01": 3, "28": 3, "1": 3, "2022": 3, "11": 3, "07": 3, "post0": 3, "03": 3, "10": 3, "31": 3, "0rc5": 3, "0rc4": 3, "30": 3, "0rc3": 3, "29": 3, "0rc2": 3, "0rc1": 3, "27": 3, "0a2": 3, "24": 3, "0a1": 3, "20": 3, "platform": 3, "fix": 3, "3": 3, "08": 3, "25": 3, "2021": 3, "09": 3, "06": 3, "05": 3, "13": 3, "2020": 3, "support": 3, "packag": 3, "4": 3, "17": 3, "22": 3, "16": 3, "15": 3, "14": 3, "12": 3, "9": 3, "8": 3, "7": 3, "6": 3, "5": 3, "context": 4, "variabl": 4, "asyncio": 4, "creat": 5, "And": [5, 10, 13, 14], "execut": 5, "subclass": 5, "The": [5, 7], "parent": [5, 7], "interrupt": 5, "throw": 5, "develop": 6, "process": 6, "github": 6, "releas": 6, "concept": 7, "switch": [7, 9, 13], "lifecycl": 7, "current": 7, "main": 7, "uncaught": 7, "ar": [7, 8], "rais": 7, "In": [7, 8], "garbag": 8, "collect": 8, "cycl": 8, "frame": 8, "manual": 8, "clear": 8, "work": 8, "suspend": 8, "Not": 8, "A": [8, 9], "Of": 8, "i": [8, 10], "leak": 8, "motiv": 9, "treat": 9, "an": 9, "asynchron": 9, "gui": 9, "like": 9, "synchron": 9, "loop": 9, "simpl": 9, "termin": 9, "app": 9, "compet": 9, "event": 9, "enter": 9, "dual": 9, "infinit": 9, "isn": 9, "t": 9, "contagi": 9, "further": 9, "read": 9, "histori": 10, "about": 10, "who": 10, "get": [10, 11], "lightweight": 11, "concurr": 11, "program": 11, "content": 11, "start": 11, "materi": 11, "advanc": 11, "usag": 11, "indic": 11, "tabl": 11, "thread": 12, "between": 13, "pass": 13, "object": 13, "control": 13, "multipl": 13, "keyword": 13, "argument": 13, "To": 13, "dead": 13, "profil": 14, "callback": 14}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx.ext.todo": 2, "sphinx.ext.viewcode": 1, "sphinx": 57}, "alltitles": {"Python API Reference": [[0, "python-api-reference"]], "Exceptions": [[0, "exceptions"], [1, "exceptions"]], "Greenlets": [[0, "greenlets"]], "Tracing": [[0, "tracing"]], "C API Reference": [[1, "c-api-reference"]], "Types": [[1, "types"]], "Functions": [[1, "functions"]], "Caveats and Known Issues": [[2, "caveats-and-known-issues"]], "Native Functions Should Be Re-entrant": [[2, "native-functions-should-be-re-entrant"]], "Use Caution Mixing Greenlets and Signal Handlers": [[2, "use-caution-mixing-greenlets-and-signal-handlers"]], "Changes": [[3, "changes"], [3, "id4"]], "2.0.2 (2023-01-28)": [[3, "id1"]], "2.0.1 (2022-11-07)": [[3, "id2"]], "2.0.0.post0 (2022-11-03)": [[3, "post0-2022-11-03"]], "2.0.0 (2022-10-31)": [[3, "id3"]], "2.0.0rc5 (2022-10-31)": [[3, "rc5-2022-10-31"]], "2.0.0rc4 (2022-10-30)": [[3, "rc4-2022-10-30"]], "2.0.0rc3 (2022-10-29)": [[3, "rc3-2022-10-29"]], "2.0.0rc2 (2022-10-28)": [[3, "rc2-2022-10-28"]], "2.0.0rc1 (2022-10-27)": [[3, "rc1-2022-10-27"]], "2.0.0a2 (2022-03-24)": [[3, "a2-2022-03-24"]], "2.0.0a1 (2022-01-20)": [[3, "a1-2022-01-20"]], "Platforms": [[3, "platforms"]], "Fixes": [[3, "fixes"]], "1.1.3.post0 (2022-10-10)": [[3, "post0-2022-10-10"]], "1.1.3 (2022-08-25)": [[3, "id5"]], "1.1.2 (2021-09-29)": [[3, "id6"]], "1.1.1 (2021-08-06)": [[3, "id7"]], "1.1.0 (2021-05-06)": [[3, "id8"]], "1.0.0 (2021-01-13)": [[3, "id9"]], "1.0a1 (2020-11-20)": [[3, "a1-2020-11-20"]], "Supported Platforms": [[3, "supported-platforms"]], "Packaging Changes": [[3, "packaging-changes"]], "0.4.17 (2020-09-22)": [[3, "id10"]], "0.4.16": [[3, "id11"]], "0.4.15": [[3, "id12"]], "0.4.14": [[3, "id13"]], "0.4.13": [[3, "id14"]], "0.4.12": [[3, "id15"]], "0.4.11": [[3, "id16"]], "0.4.10": [[3, "id17"]], "0.4.9": [[3, "id18"]], "0.4.8": [[3, "id19"]], "0.4.7": [[3, "id20"]], "0.4.6": [[3, "id21"]], "0.4.5": [[3, "id22"]], "0.4.4": [[3, "id23"]], "0.4.3": [[3, "id24"]], "0.4.2": [[3, "id25"]], "0.4.1": [[3, "id26"]], "0.4.0": [[3, "id27"]], "0.3.4": [[3, "id28"]], "0.3.3": [[3, "id29"]], "0.3.2": [[3, "id30"]], "0.3.1": [[3, "id31"]], "0.3": [[3, "id32"]], "Context Variables (asyncio)": [[4, "context-variables-asyncio"]], "Creating And Executing Greenlets": [[5, "creating-and-executing-greenlets"]], "Subclassing greenlet": [[5, "subclassing-greenlet"]], "Changing The Parent": [[5, "changing-the-parent"]], "Interrupting Greenlets by Throwing Exceptions": [[5, "interrupting-greenlets-by-throwing-exceptions"]], "Development Process": [[6, "development-process"]], "Github": [[6, "github"]], "Releases": [[6, "releases"]], "greenlet Concepts": [[7, "greenlet-concepts"]], "Switching greenlets": [[7, "switching-greenlets"]], "The greenlet Lifecycle": [[7, "the-greenlet-lifecycle"]], "The Current greenlet": [[7, "the-current-greenlet"]], "The Main greenlet": [[7, "the-main-greenlet"]], "Greenlet Parents": [[7, "greenlet-parents"]], "Uncaught Exceptions are Raised In the Parent": [[7, "uncaught-exceptions-are-raised-in-the-parent"]], "Garbage Collection and greenlets": [[8, "garbage-collection-and-greenlets"]], "Cycles In Frames": [[8, "cycles-in-frames"]], "Manually Clearing Cycles Works": [[8, "manually-clearing-cycles-works"]], "Cycles In Suspended Frames Are Not Collected": [[8, "cycles-in-suspended-frames-are-not-collected"]], "A Cycle Of Greenlets Is A Leak": [[8, "a-cycle-of-greenlets-is-a-leak"]], "Motivation: Treating an Asynchronous GUI Like a Synchronous Loop": [[9, "motivation-treating-an-asynchronous-gui-like-a-synchronous-loop"]], "A Simple Terminal App": [[9, "a-simple-terminal-app"]], "Competing Event Loops": [[9, "competing-event-loops"]], "Enter greenlets: Dual Infinite Loops": [[9, "enter-greenlets-dual-infinite-loops"]], "Switching Isn\u2019t Contagious": [[9, null]], "Further Reading": [[9, "further-reading"]], "History And About": [[10, "history-and-about"]], "Who is using Greenlet?": [[10, "who-is-using-greenlet"]], "Getting Greenlet": [[10, "getting-greenlet"]], "greenlet: Lightweight concurrent programming": [[11, "greenlet-lightweight-concurrent-programming"]], "Contents": [[11, null]], "Getting Started": [[11, null]], "Reference Material": [[11, null]], "Advanced Usage": [[11, null]], "Indices and tables": [[11, "indices-and-tables"]], "Greenlets and Python Threads": [[12, "greenlets-and-python-threads"]], "Switching Between Greenlets: Passing Objects and Control": [[13, "switching-between-greenlets-passing-objects-and-control"]], "Multiple And Keyword Arguments": [[13, "multiple-and-keyword-arguments"]], "Switching To Dead Greenlets": [[13, "switching-to-dead-greenlets"]], "Tracing And Profiling": [[14, "tracing-and-profiling"]], "Trace Callback Functions": [[14, "trace-callback-functions"]]}, "indexentries": {"greenletexit": [[0, "greenlet.GreenletExit"]], "dead (greenlet.greenlet attribute)": [[0, "greenlet.greenlet.dead"]], "error": [[0, "greenlet.error"]], "getcurrent() (in module greenlet)": [[0, "greenlet.getcurrent"]], "gettrace() (in module greenlet)": [[0, "greenlet.gettrace"]], "gr_context (greenlet.greenlet attribute)": [[0, "greenlet.greenlet.gr_context"]], "gr_frame (greenlet.greenlet attribute)": [[0, "greenlet.greenlet.gr_frame"]], "greenlet (class in greenlet)": [[0, "greenlet.greenlet"]], "parent (greenlet.greenlet attribute)": [[0, "greenlet.greenlet.parent"]], "run (greenlet.greenlet attribute)": [[0, "greenlet.greenlet.run"]], "settrace() (in module greenlet)": [[0, "greenlet.settrace"]], "switch() (greenlet.greenlet method)": [[0, "greenlet.greenlet.switch"]], "throw() (greenlet.greenlet method)": [[0, "greenlet.greenlet.throw"]], "pyexc_greenleterror (c type)": [[1, "c.PyExc_GreenletError"]], "pyexc_greenletexit (c type)": [[1, "c.PyExc_GreenletExit"]], "pygreenlet (c type)": [[1, "c.PyGreenlet"]], "pygreenlet_active (c function)": [[1, "c.PyGreenlet_ACTIVE"]], "pygreenlet_check (c function)": [[1, "c.PyGreenlet_Check"]], "pygreenlet_getcurrent (c function)": [[1, "c.PyGreenlet_GetCurrent"]], "pygreenlet_getparent (c function)": [[1, "c.PyGreenlet_GetParent"]], "pygreenlet_import (c function)": [[1, "c.PyGreenlet_Import"]], "pygreenlet_new (c function)": [[1, "c.PyGreenlet_New"]], "pygreenlet_started (c function)": [[1, "c.PyGreenlet_STARTED"]], "pygreenlet_setparent (c function)": [[1, "c.PyGreenlet_SetParent"]], "pygreenlet_switch (c function)": [[1, "c.PyGreenlet_Switch"]], "pygreenlet_throw (c function)": [[1, "c.PyGreenlet_Throw"]], "pep 567": [[4, "index-0"]], "python enhancement proposals": [[4, "index-0"]]}})