Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aisk/multicorn
Multicorn is a multi-interpreter server for Python.
https://github.com/aisk/multicorn
asgi gunicorn pep554 python web webserver wsgi
Last synced: 18 days ago
JSON representation
Multicorn is a multi-interpreter server for Python.
- Host: GitHub
- URL: https://github.com/aisk/multicorn
- Owner: aisk
- License: mit
- Created: 2013-03-12T07:02:38.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T21:30:21.000Z (about 2 months ago)
- Last Synced: 2024-11-29T23:16:31.595Z (23 days ago)
- Topics: asgi, gunicorn, pep554, python, web, webserver, wsgi
- Language: Python
- Homepage:
- Size: 200 KB
- Stars: 34
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# multicorn
![multicorn](https://i.redd.it/ipomv2xs5ew41.jpg)
Multicorn is an experimental multi-interpreter server/framework for Python.
## Motivation
For a long time, Python programmers were suffered from Python's GIL issue when building server-side applications. To fully use the multiple CPU cores on modern machines, we have to use multi-processing since one python interpreter instance can only use one CPU core because of the GIL.
This caused huge memory costs and made stateful server programming harder because we can't share data between processes easily.
[PEP554](https://www.python.org/dev/peps/pep-0554/) brings the new hope: we can have multiple python interpreters in one process, and every interpreter has its own GIL. All the interpreters can run parallel.
Multicorn is an experimental project for writing server-side network applications in multi-interpreters. It's more like a multi-interpreter version of [gunicorn](https://gunicorn.org/), instead of using multi-process.
## Current status
- [x] Support run TCP server in multi-interpreters.
- [x] Support run WSGI server in multi-interpreters.
- [ ] Support run ASGI server in multi-interpreters.
- [ ] Manage the life cycle of sub-interpreters.## Limitations
Multicorn is using private modules which are added in python3.8, so python3.8 or later is required.
For the current implementation of the sub-interpreter in python, the GIL is shared between all sub-interpreters. So multicorn can not use multi CPU cores in one process now sadly. There is a project to solve it: [multi-core-python](https://github.com/ericsnowcurrently/multi-core-python/), let's keep tracking on it.
## License
Multicore is distributed by a [MIT license](https://github.com/aisk/multicorn/tree/master/LICENSE).