https://github.com/anuprshetty/fast_python
Multi threading, multi processing and event loop in Python.
https://github.com/anuprshetty/fast_python
asynchronous-programming eventloop multiprocessing multithreading python
Last synced: about 1 year ago
JSON representation
Multi threading, multi processing and event loop in Python.
- Host: GitHub
- URL: https://github.com/anuprshetty/fast_python
- Owner: anuprshetty
- Created: 2022-03-23T05:48:47.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-21T06:45:06.000Z (about 2 years ago)
- Last Synced: 2025-01-08T10:10:53.323Z (about 1 year ago)
- Topics: asynchronous-programming, eventloop, multiprocessing, multithreading, python
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fast Python
Multi threading, multi processing and event loop in Python.
## asyncio
- Python framework enabling asynchronous single threaded concurrent code using coroutines.
- Goal of asyncio: maximize the usage of a single thread by handling I/O asynchronously, and by enabling concurrent code using coroutines.
- asyncio enables single threaded programs to be more productive by filling the gaps that would otherwise be wasted on waiting on I/O. To do this efficiently asyncio avoids blocking functions. And instead uses coroutines which can be executed in small chunks concurrently.
- concurrency is dealing with many things at the same time while being able to do only one thing at a time.
- On very I/O heavy workloads, asyncio can be orders of magnitude faster than blocking I/O. This is why so many important web technologies are built using asyncio like nginx, redis, node.js, browser, etc.
### event loop
- what an event loop is doing? It's calling callbacks in some order one by one.