ENع
الدرس 29 · Under the hood

Threads, processes and the GIL

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

A process is a running program with its own memory; threads are workers inside it that share that memory. Step through an eight-line program, count.py, in which two threads each add 1 to count, and watch CPython's global interpreter lock (the GIL) let only one of them run Python code at a time. See how a badly timed switch loses an update, why threads still help with waiting, and how a second process gets its own interpreter, memory and GIL so two cores can work at once.

14 دقيقة11 خطوات5 أسئلةAdvanced
شكل 29 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.