Knowledge (XXG)

Stackless Python

Source 📝

635: 831: 405: 339: 1012: 168: 66: 25: 552:). Microthreads manage the execution of different subtasks in a program on the same CPU core. Thus, they are an alternative to event-based asynchronous programming and also avoid the overhead of using separate threads for single-core programs (because no mode switching between user mode and kernel mode needs to be done, so CPU usage can be reduced). 567:(preemption was originally not available but is now in some form). To use multiple CPU cores, one would still need to build an interprocess communication system on top of Stackless Python processes. 901: 1151: 1059: 508:
for its own stack. In practice, Stackless Python uses the C stack, but the stack is cleared between function calls. The most prominent feature of Stackless is
894: 1156: 536:
With Stackless Python, a running program is split into microthreads that are managed by the language interpreter itself, not the operating system
887: 1082: 640: 570:
Due to the considerable number of changes in the source, Stackless Python cannot be installed on a preexisting Python installation as an
920: 1020: 466: 269: 251: 185: 149: 52: 38: 87: 80: 736: 555:
Although microthreads make it easier to deal with running subtasks on a single core, Stackless Python does not remove CPython's
232: 130: 578:. It is instead a complete Python distribution in itself. The majority of Stackless's features have also been implemented in 204: 189: 102: 1146: 910: 648: 498: 422: 598:
Although the whole Stackless is a separate distribution, its switching functionality has been successfully packaged as a
1077: 709: 653: 384: 211: 109: 867: 358: 330: 873: 1119: 218: 178: 116: 76: 658: 537: 587: 583: 560: 502: 418: 753:
a round robin scheduler is built in. It can be used to schedule tasklets either cooperatively or preemptively.
200: 98: 1113: 999: 556: 454: 545: 521: 44: 1092: 683: 853: 849: 845: 841: 837: 575: 571: 449: 338: 705: 564: 513: 1124: 1053: 442: 225: 123: 1100: 663: 461: 429: 1028: 993: 602:
extension called greenlet. It is used by a number of libraries (e.g. gevent) to provide a
404: 830: 978: 765: 541: 1140: 928: 740: 606:
solution for CPython. Python since has received a native solution for green threads:
525: 603: 549: 1011: 824: 948: 607: 509: 167: 65: 958: 714: 630: 615: 505: 298: 288: 858: 784:"greenlet: Lightweight concurrent programming — greenlet 0.4.0 documentation" 783: 548:
is done purely in the interpreter (these are thus also regarded as a form of
393: 1038: 983: 517: 512:, which avoid much of the overhead associated with usual operating system 933: 620: 1043: 938: 721: 599: 559:, nor does it use multiple threads and/or processes. So it allows only 963: 943: 862: 1048: 968: 953: 516:. In addition to Python features, Stackless also adds support for 438: 434: 1033: 973: 579: 883: 161: 59: 18: 477: 766:"Application-level Stackless features — PyPy documentation" 613:
Stackless is used extensively in the implementation of the
879: 501:
interpreter, so named because it avoids depending on the
801: 1091: 1070: 1019: 919: 802:"What is gevent? — gevent 1.3.0.dev0 documentation" 472: 460: 448: 428: 414: 383: 357: 329: 307: 297: 287: 192:. Unsourced material may be challenged and removed. 868:Multithreaded Game Scripting with Stackless Python 619:massively multiplayer online game as well as in 1152:Python (programming language) implementations 895: 8: 282: 53:Learn how and when to remove these messages 902: 888: 880: 829: 403: 337: 281: 270:Learn how and when to remove this message 252:Learn how and when to remove this message 150:Learn how and when to remove this message 675: 86:Please improve this article by adding 7: 836:Stackless Python Documentation for: 641:Free and open-source software portal 190:adding citations to reliable sources 874:Continuations and Stackless Python 467:Python Software Foundation License 14: 34:This article has multiple issues. 16:Alternative Python implementation 1010: 633: 166: 64: 23: 177:needs additional citations for 42:or discuss these issues on the 1157:Software using the PSF license 1: 716:The story of stackless Python 649:Erlang (programming language) 88:secondary or tertiary sources 654:Limbo (programming language) 499:Python programming language 313:; 26 years ago 1173: 1120:Python Software Foundation 1109: 1008: 659:Go (programming language) 379: 325: 788:greenlet.readthedocs.org 563:on a shared CPU and not 561:cooperative multitasking 586:Python interpreter and 557:Global Interpreter Lock 342:/ January 22, 2020 75:relies excessively on 366:; 3 years ago 344:; 4 years ago 1147:Concurrent computing 770:pypy.readthedocs.org 684:"Release v3.8.1-slp" 186:improve this article 876:by Christian Tismer 284: 870:by Harry Kalogirou 623:'s mail platform. 289:Original author(s) 201:"Stackless Python" 99:"Stackless Python" 1134: 1133: 1125:Python Conference 737:"About Stackless" 542:context switching 488: 487: 280: 279: 272: 262: 261: 254: 236: 160: 159: 152: 134: 57: 1164: 1101:Guido van Rossum 1014: 989:Stackless Python 913: 904: 897: 890: 881: 833: 828: 827: 825:Official website 810: 809: 798: 792: 791: 780: 774: 773: 762: 756: 755: 750: 748: 739:. Archived from 733: 727: 726: 702: 696: 695: 693: 691: 686:. 12 August 2021 680: 664:SCOOP (software) 643: 638: 637: 636: 520:, communication 491:Stackless Python 484: 481: 479: 430:Operating system 407: 402: 399: 397: 395: 374: 372: 367: 352: 350: 345: 341: 321: 319: 314: 293:Christian Tismer 285: 283:Stackless Python 275: 268: 257: 250: 246: 243: 237: 235: 194: 170: 162: 155: 148: 144: 141: 135: 133: 92: 68: 60: 49: 27: 26: 19: 1172: 1171: 1167: 1166: 1165: 1163: 1162: 1161: 1137: 1136: 1135: 1130: 1105: 1087: 1066: 1015: 1006: 994:Unladen Swallow 921:Implementations 915: 911: 908: 823: 822: 819: 814: 813: 800: 799: 795: 782: 781: 777: 764: 763: 759: 746: 744: 743:on 23 June 2020 735: 734: 730: 713: 710:Wayback Machine 703: 699: 689: 687: 682: 681: 677: 672: 639: 634: 632: 629: 604:green threading 596: 546:task scheduling 534: 476: 410: 392: 375: 370: 368: 365: 359:Preview release 353: 348: 346: 343: 336:3.8.1-slp  317: 315: 312: 308:Initial release 276: 265: 264: 263: 258: 247: 241: 238: 195: 193: 183: 171: 156: 145: 139: 136: 93: 91: 85: 81:primary sources 69: 28: 24: 17: 12: 11: 5: 1170: 1168: 1160: 1159: 1154: 1149: 1139: 1138: 1132: 1131: 1129: 1128: 1122: 1117: 1110: 1107: 1106: 1104: 1103: 1097: 1095: 1089: 1088: 1086: 1085: 1080: 1074: 1072: 1068: 1067: 1065: 1064: 1056: 1051: 1046: 1041: 1036: 1031: 1025: 1023: 1017: 1016: 1009: 1007: 1005: 1004: 996: 991: 986: 981: 979:Python for S60 976: 971: 966: 961: 956: 951: 946: 941: 936: 931: 925: 923: 917: 916: 909: 907: 906: 899: 892: 884: 878: 877: 871: 865: 856: 834: 818: 817:External links 815: 812: 811: 806:www.gevent.org 793: 775: 757: 728: 697: 674: 673: 671: 668: 667: 666: 661: 656: 651: 645: 644: 628: 625: 595: 592: 533: 530: 486: 485: 474: 470: 469: 464: 458: 457: 452: 446: 445: 432: 426: 425: 416: 412: 411: 409: 408: 398:/stackless-dev 389: 387: 381: 380: 377: 376: 371:12 August 2021 364:12 August 2021 363: 361: 355: 354: 335: 333: 331:Stable release 327: 326: 323: 322: 309: 305: 304: 301: 295: 294: 291: 278: 277: 260: 259: 174: 172: 165: 158: 157: 72: 70: 63: 58: 32: 31: 29: 22: 15: 13: 10: 9: 6: 4: 3: 2: 1169: 1158: 1155: 1153: 1150: 1148: 1145: 1144: 1142: 1126: 1123: 1121: 1118: 1115: 1112: 1111: 1108: 1102: 1099: 1098: 1096: 1094: 1090: 1084: 1081: 1079: 1076: 1075: 1073: 1069: 1063: 1061: 1057: 1055: 1052: 1050: 1047: 1045: 1042: 1040: 1037: 1035: 1032: 1030: 1027: 1026: 1024: 1022: 1018: 1013: 1003: 1001: 997: 995: 992: 990: 987: 985: 982: 980: 977: 975: 972: 970: 967: 965: 962: 960: 957: 955: 952: 950: 947: 945: 942: 940: 937: 935: 932: 930: 929:CircuitPython 927: 926: 924: 922: 918: 914: 905: 900: 898: 893: 891: 886: 885: 882: 875: 872: 869: 866: 864: 860: 857: 855: 851: 847: 843: 839: 835: 832: 826: 821: 820: 816: 807: 803: 797: 794: 789: 785: 779: 776: 771: 767: 761: 758: 754: 742: 738: 732: 729: 724: 723: 718: 717: 711: 707: 701: 698: 685: 679: 676: 669: 665: 662: 660: 657: 655: 652: 650: 647: 646: 642: 631: 626: 624: 622: 618: 617: 611: 609: 605: 601: 593: 591: 589: 585: 581: 577: 573: 568: 566: 562: 558: 553: 551: 547: 543: 539: 531: 529: 527: 526:serialization 523: 519: 515: 511: 507: 504: 500: 496: 492: 483: 475: 471: 468: 465: 463: 459: 456: 453: 451: 447: 444: 440: 436: 433: 431: 427: 424: 420: 417: 413: 406: 401: 391: 390: 388: 386: 382: 378: 362: 360: 356: 340: 334: 332: 328: 324: 310: 306: 302: 300: 296: 292: 290: 286: 274: 271: 256: 253: 245: 234: 231: 227: 224: 220: 217: 213: 210: 206: 203: –  202: 198: 197:Find sources: 191: 187: 181: 180: 175:This article 173: 169: 164: 163: 154: 151: 143: 140:December 2017 132: 129: 125: 122: 118: 115: 111: 108: 104: 101: –  100: 96: 95:Find sources: 89: 83: 82: 78: 73:This article 71: 67: 62: 61: 56: 54: 47: 46: 41: 40: 35: 30: 21: 20: 1058: 998: 988: 805: 796: 787: 778: 769: 760: 752: 745:. Retrieved 741:the original 731: 720: 715: 706:Ghostarchive 704:Archived at 700: 688:. Retrieved 678: 614: 612: 597: 588:JIT compiler 584:self-hosting 569: 554: 550:green thread 535: 510:microthreads 494: 490: 489: 303:Anselm Kruis 299:Developer(s) 266: 248: 239: 229: 222: 215: 208: 196: 184:Please help 179:verification 176: 146: 137: 127: 120: 113: 106: 94: 74: 50: 43: 37: 36:Please help 33: 949:MicroPython 565:parallelism 524:, and task 455:Interpreter 1141:Categories 959:IronPython 670:References 616:Eve Online 518:coroutines 506:call stack 480:.stackless 415:Written in 400:/stackless 385:Repository 349:2020-01-22 242:March 2013 212:newspapers 110:newspapers 77:references 39:improve it 1039:Ninja-IDE 984:Shed Skin 859:stackless 747:26 August 572:extension 495:Stackless 45:talk page 1114:Software 1093:Designer 934:CLPython 708:and the 627:See also 621:IronPort 610:/async. 522:channels 1127:(PyCon) 1044:PyCharm 939:CPython 854:2.7-slp 850:3.4-slp 846:3.5-slp 842:3.6-slp 838:3.7-slp 722:YouTube 690:8 March 600:CPython 576:library 514:threads 497:, is a 473:Website 462:License 443:Windows 369: ( 347: ( 316: ( 226:scholar 124:scholar 1116:(list) 1071:Topics 1054:Spyder 964:Jython 944:Cython 912:Python 863:GitHub 538:kernel 532:Design 423:Python 394:github 228:  221:  214:  207:  199:  126:  119:  112:  105:  97:  1049:PyDev 969:Psyco 954:Numba 608:await 493:, or 439:macOS 435:Linux 233:JSTOR 219:books 131:JSTOR 117:books 1083:ASGI 1078:WSGI 1060:more 1034:IDLE 1029:eric 1021:IDEs 1000:more 974:PyPy 749:2016 692:2022 582:, a 580:PyPy 544:and 482:.com 450:Type 396:.com 318:1998 311:1998 205:news 103:news 1062:... 1002:... 861:on 594:Use 574:or 478:www 188:by 79:to 1143:: 852:, 848:, 844:, 840:, 804:. 786:. 768:. 751:. 719:. 712:: 590:. 528:. 441:, 437:, 421:, 90:. 48:. 903:e 896:t 889:v 808:. 790:. 772:. 725:. 694:. 540:— 503:C 419:C 373:) 351:) 320:) 273:) 267:( 255:) 249:( 244:) 240:( 230:· 223:· 216:· 209:· 182:. 153:) 147:( 142:) 138:( 128:· 121:· 114:· 107:· 84:. 55:) 51:(

Index

improve it
talk page
Learn how and when to remove these messages

references
primary sources
secondary or tertiary sources
"Stackless Python"
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message

verification
improve this article
adding citations to reliable sources
"Stackless Python"
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message
Learn how and when to remove this message
Original author(s)
Developer(s)
Stable release
Edit this on Wikidata

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.