Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add main topic Concurrency #5973

Open
madmanRE opened this issue Jun 29, 2024 · 0 comments
Open

Add main topic Concurrency #5973

madmanRE opened this issue Jun 29, 2024 · 0 comments
Labels
python Roadmap: python topic-change Missing or deprecated topics in roadmap

Comments

@madmanRE
Copy link

Roadmap URL

https://roadmap.sh/python

Suggestions

Concurrency

Concurrency in Python allows multiple tasks to be executed simultaneously using different approaches. GIL (Global Interpreter Lock) limits thread execution, making multithreading less efficient for computational tasks, but suitable for I/O. Multiprocessing, using the multiprocessing module, allows multiple cores to be utilized, providing true parallelism. Asynchrony via asyncio is optimal for I/O operations, allowing thousands of connections to be processed simultaneously without blocking. The choice of approach depends on the nature of the task.

Relevant links

(subtopics below)

GIL

GIL is a mechanism that allows only one thread to execute Python code at a time. This limitation is related to memory management in CPython and can reduce the efficiency of multithreaded applications on multi-core systems.

Relevant links

Threading

Multithreading allows multiple threads within a single process. However, because of GIL, threads cannot run in parallel on different cores, which makes multithreading suitable for I/O tasks (e.g., network requests) but not for computational tasks.

Relevant links

Multiprocessing

Multiprocessing utilizes multiple processes, each with its own GIL. This allows full utilization of multiple processor cores, which is effective for computationally intensive tasks. Python's multiprocessing module supports creating processes and exchanging data between them.

Relevant links

Asynchrony

Asynchronous programming, supported by asyncio, allows code to be executed without blocking, using async and await. This is especially useful for I/O tasks such as networking or file manipulation, allowing thousands of connections to be handled without blocking the main thread.

Relevant links

@madmanRE madmanRE added the topic-change Missing or deprecated topics in roadmap label Jun 29, 2024
@github-actions github-actions bot added the python Roadmap: python label Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Roadmap: python topic-change Missing or deprecated topics in roadmap
Projects
None yet
Development

No branches or pull requests

1 participant