Multiprocessing

Parallel processing with processes

Interview Relevant: CPU-bound tasks

Multiprocessing

Bypass the GIL by using separate processes.

Code Examples

python
1from multiprocessing import Process
2
3def worker():
4    print("Working in separate process")
5
6p = Process(target=worker)
7p.start()
8p.join()

AI Tutor

Ask about the topic

Sign in Required

Please sign in to use the AI tutor

Sign In