Python ત્રણ concurrency મોડેલો પ્રદાન કરે છે, અને સાચો પસંદગી મુખ્યત્વે તમના કાર્યને I/O-bound અથવા CPU-bound છે કે નહીં તેના પર આધારિત છે — એક નિર્ણય જે GIL (જે threads ને Python કોડ સમાંતર રીતે ચલાવવાથી અટકાવે છે) દ્વારા ખૂબ અસર પામ્યો છે।
ત્રણ મોડેલો
threading → multiple threads, ONE process. GIL-limited for CPU.
multiprocessing → multiple PROCESSES, each its own interpreter/GIL → true parallelism.
asyncio → single thread, cooperative coroutines yielding at await points.
