GVL (Global VM Lock, पहिले GIL भनिन्थ्यो) MRI Ruby मा एक पल मा केवल एक thread ले Ruby code को execution गर्न सक्छ — त्यसैले threads ले true CPU parallelism प्रदान गर्दैन। तर GVL I/O को समयमा release हुन्छ, त्यसैले threads I/O-bound काम को लागि मदद गर्छ। CPU parallelism को लागि, तपाई multiple processes प्रयोग गर्नुहुन्छ। यो Python को GIL परिस्थिति को प्रतिबिम्ब हो।
GVL: एक पल मा एक thread ले Ruby code चलाउँछ
MRI (the standard Ruby) has a GLOBAL VM LOCK:
→ only ONE thread executes Ruby code at any instant (no CPU parallelism from threads)
→ BUT the GVL is RELEASED during blocking I/O (network, file, DB)
So: threads help for I/O-bound work, NOT for CPU-bound work.
